From a770f7a3409a213c8ae6b619313a3aeb3e1bc762 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 11 Feb 2026 03:07:07 +0000 Subject: [PATCH 1/2] feat: add Natural Language Query Understanding fields and messages to DiscoveryEngine request, response, and datastore messages feat: add CrowdingSpec to SearchRequest to set crowding settings feat: add output-only field SemanticState to SearchResponse. docs: update documentation for search and data store NLQ features docs: other misc documentation updates Clients can specify Natural Language Query Understanding-related fields, as well as CrowdingSpec. These features are available in the V1 APIs. PiperOrigin-RevId: 868345232 Source-Link: https://github.com/googleapis/googleapis/commit/56bc1b49df17f062f4528a398115768711f1894f Source-Link: https://github.com/googleapis/googleapis-gen/commit/cee58771c94e2378416a9ff9543460e1d2327c2d Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeV9lbmdpbmUtdjEvLk93bEJvdC55YW1sIiwiaCI6ImNlZTU4NzcxYzk0ZTIzNzg0MTZhOWZmOTU0MzQ2MGUxZDIzMjdjMmQifQ== --- .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-discovery_engine-v1/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-discovery_engine-v1/Gemfile | 11 + .../LICENSE.md | 201 + .../README.md | 153 + .../google-cloud-discovery_engine-v1/Rakefile | 169 + .../gapic_metadata.json | 678 +++ .../google-cloud-discovery_engine-v1.gemspec | 29 + .../lib/google-cloud-discovery_engine-v1.rb | 21 + .../lib/google/cloud/discovery_engine/v1.rb | 65 + .../discovery_engine/v1/assistant_service.rb | 55 + .../v1/assistant_service/client.rb | 526 +++ .../v1/assistant_service/credentials.rb | 47 + .../v1/assistant_service/paths.rb | 169 + .../v1/assistant_service/rest.rb | 52 + .../v1/assistant_service/rest/client.rb | 478 ++ .../v1/assistant_service/rest/service_stub.rb | 137 + .../v1/cmek_config_service.rb | 56 + .../v1/cmek_config_service/client.rb | 820 ++++ .../v1/cmek_config_service/credentials.rb | 47 + .../v1/cmek_config_service/operations.rb | 841 ++++ .../v1/cmek_config_service/paths.rb | 135 + .../v1/cmek_config_service/rest.rb | 53 + .../v1/cmek_config_service/rest/client.rb | 749 ++++ .../v1/cmek_config_service/rest/operations.rb | 1159 +++++ .../cmek_config_service/rest/service_stub.rb | 341 ++ .../discovery_engine/v1/completion_service.rb | 56 + .../v1/completion_service/client.rb | 1000 +++++ .../v1/completion_service/credentials.rb | 47 + .../v1/completion_service/operations.rb | 841 ++++ .../v1/completion_service/paths.rb | 78 + .../v1/completion_service/rest.rb | 53 + .../v1/completion_service/rest/client.rb | 922 ++++ .../v1/completion_service/rest/operations.rb | 1159 +++++ .../completion_service/rest/service_stub.rb | 429 ++ .../discovery_engine/v1/control_service.rb | 58 + .../v1/control_service/client.rb | 922 ++++ .../v1/control_service/credentials.rb | 47 + .../v1/control_service/paths.rb | 220 + .../v1/control_service/rest.rb | 55 + .../v1/control_service/rest/client.rb | 844 ++++ .../v1/control_service/rest/service_stub.rb | 462 ++ .../v1/conversational_search_service.rb | 55 + .../conversational_search_service/client.rb | 2026 +++++++++ .../credentials.rb | 47 + .../v1/conversational_search_service/paths.rb | 491 +++ .../v1/conversational_search_service/rest.rb | 52 + .../rest/client.rb | 1887 ++++++++ .../rest/service_stub.rb | 1146 +++++ .../discovery_engine/v1/data_store_service.rb | 57 + .../v1/data_store_service/client.rb | 1000 +++++ .../v1/data_store_service/credentials.rb | 47 + .../v1/data_store_service/operations.rb | 841 ++++ .../v1/data_store_service/paths.rb | 295 ++ .../v1/data_store_service/rest.rb | 54 + .../v1/data_store_service/rest/client.rb | 922 ++++ .../v1/data_store_service/rest/operations.rb | 1159 +++++ .../data_store_service/rest/service_stub.rb | 425 ++ .../discovery_engine/v1/document_service.rb | 57 + .../v1/document_service/client.rb | 1426 ++++++ .../v1/document_service/credentials.rb | 47 + .../v1/document_service/operations.rb | 841 ++++ .../v1/document_service/paths.rb | 181 + .../v1/document_service/rest.rb | 54 + .../v1/document_service/rest/client.rb | 1327 ++++++ .../v1/document_service/rest/operations.rb | 1159 +++++ .../v1/document_service/rest/service_stub.rb | 633 +++ .../discovery_engine/v1/engine_service.rb | 57 + .../v1/engine_service/client.rb | 942 ++++ .../v1/engine_service/credentials.rb | 47 + .../v1/engine_service/operations.rb | 841 ++++ .../v1/engine_service/paths.rb | 73 + .../v1/engine_service/rest.rb | 54 + .../v1/engine_service/rest/client.rb | 864 ++++ .../v1/engine_service/rest/operations.rb | 1159 +++++ .../v1/engine_service/rest/service_stub.rb | 388 ++ .../v1/grounded_generation_service.rb | 55 + .../v1/grounded_generation_service/client.rb | 733 ++++ .../credentials.rb | 47 + .../v1/grounded_generation_service/paths.rb | 137 + .../v1/grounded_generation_service/rest.rb | 52 + .../rest/client.rb | 591 +++ .../rest/service_stub.rb | 205 + .../v1/identity_mapping_store_service.rb | 56 + .../identity_mapping_store_service/client.rb | 1177 +++++ .../credentials.rb | 47 + .../operations.rb | 841 ++++ .../identity_mapping_store_service/paths.rb | 154 + .../v1/identity_mapping_store_service/rest.rb | 53 + .../rest/client.rb | 1085 +++++ .../rest/operations.rb | 1159 +++++ .../rest/service_stub.rb | 511 +++ .../discovery_engine/v1/project_service.rb | 57 + .../v1/project_service/client.rb | 536 +++ .../v1/project_service/credentials.rb | 47 + .../v1/project_service/operations.rb | 841 ++++ .../v1/project_service/paths.rb | 47 + .../v1/project_service/rest.rb | 54 + .../v1/project_service/rest/client.rb | 486 +++ .../v1/project_service/rest/operations.rb | 1159 +++++ .../v1/project_service/rest/service_stub.rb | 143 + .../cloud/discovery_engine/v1/rank_service.rb | 55 + .../v1/rank_service/client.rb | 531 +++ .../v1/rank_service/credentials.rb | 47 + .../discovery_engine/v1/rank_service/paths.rb | 52 + .../discovery_engine/v1/rank_service/rest.rb | 52 + .../v1/rank_service/rest/client.rb | 481 ++ .../v1/rank_service/rest/service_stub.rb | 143 + .../v1/recommendation_service.rb | 55 + .../v1/recommendation_service/client.rb | 609 +++ .../v1/recommendation_service/credentials.rb | 47 + .../v1/recommendation_service/paths.rb | 220 + .../v1/recommendation_service/rest.rb | 52 + .../v1/recommendation_service/rest/client.rb | 559 +++ .../rest/service_stub.rb | 159 + .../google/cloud/discovery_engine/v1/rest.rb | 57 + .../discovery_engine/v1/schema_service.rb | 56 + .../v1/schema_service/client.rb | 945 ++++ .../v1/schema_service/credentials.rb | 47 + .../v1/schema_service/operations.rb | 841 ++++ .../v1/schema_service/paths.rb | 127 + .../v1/schema_service/rest.rb | 53 + .../v1/schema_service/rest/client.rb | 867 ++++ .../v1/schema_service/rest/operations.rb | 1159 +++++ .../v1/schema_service/rest/service_stub.rb | 425 ++ .../discovery_engine/v1/search_service.rb | 55 + .../v1/search_service/client.rb | 1315 ++++++ .../v1/search_service/credentials.rb | 47 + .../v1/search_service/paths.rb | 263 ++ .../v1/search_service/rest.rb | 52 + .../v1/search_service/rest/client.rb | 1258 ++++++ .../v1/search_service/rest/service_stub.rb | 237 + .../v1/search_tuning_service.rb | 56 + .../v1/search_tuning_service/client.rb | 621 +++ .../v1/search_tuning_service/credentials.rb | 47 + .../v1/search_tuning_service/operations.rb | 841 ++++ .../v1/search_tuning_service/paths.rb | 78 + .../v1/search_tuning_service/rest.rb | 53 + .../v1/search_tuning_service/rest/client.rb | 564 +++ .../search_tuning_service/rest/operations.rb | 1159 +++++ .../rest/service_stub.rb | 204 + .../v1/serving_config_service.rb | 56 + .../v1/serving_config_service/client.rb | 501 +++ .../v1/serving_config_service/credentials.rb | 47 + .../v1/serving_config_service/paths.rb | 101 + .../v1/serving_config_service/rest.rb | 53 + .../v1/serving_config_service/rest/client.rb | 451 ++ .../rest/service_stub.rb | 159 + .../discovery_engine/v1/session_service.rb | 55 + .../v1/session_service/client.rb | 937 ++++ .../v1/session_service/credentials.rb | 47 + .../v1/session_service/paths.rb | 355 ++ .../v1/session_service/rest.rb | 52 + .../v1/session_service/rest/client.rb | 859 ++++ .../v1/session_service/rest/service_stub.rb | 462 ++ .../v1/site_search_engine_service.rb | 56 + .../v1/site_search_engine_service/client.rb | 2012 +++++++++ .../site_search_engine_service/credentials.rb | 47 + .../site_search_engine_service/operations.rb | 841 ++++ .../v1/site_search_engine_service/paths.rb | 176 + .../v1/site_search_engine_service/rest.rb | 53 + .../site_search_engine_service/rest/client.rb | 1864 ++++++++ .../rest/operations.rb | 1159 +++++ .../rest/service_stub.rb | 1102 +++++ .../discovery_engine/v1/user_event_service.rb | 56 + .../v1/user_event_service/client.rb | 911 ++++ .../v1/user_event_service/credentials.rb | 47 + .../v1/user_event_service/operations.rb | 841 ++++ .../v1/user_event_service/paths.rb | 152 + .../v1/user_event_service/rest.rb | 53 + .../v1/user_event_service/rest/client.rb | 840 ++++ .../v1/user_event_service/rest/operations.rb | 1159 +++++ .../user_event_service/rest/service_stub.rb | 382 ++ .../v1/user_license_service.rb | 56 + .../v1/user_license_service/client.rb | 647 +++ .../v1/user_license_service/credentials.rb | 47 + .../v1/user_license_service/operations.rb | 841 ++++ .../v1/user_license_service/paths.rb | 71 + .../v1/user_license_service/rest.rb | 53 + .../v1/user_license_service/rest/client.rb | 590 +++ .../user_license_service/rest/operations.rb | 1159 +++++ .../user_license_service/rest/service_stub.rb | 204 + .../cloud/discovery_engine/v1/version.rb | 28 + .../cloud/discoveryengine/v1/answer_pb.rb | 73 + .../discoveryengine/v1/assist_answer_pb.rb | 59 + .../cloud/discoveryengine/v1/assistant_pb.rb | 45 + .../v1/assistant_service_pb.rb | 62 + .../v1/assistant_service_services_pb.rb | 45 + .../cloud/discoveryengine/v1/chunk_pb.rb | 53 + .../v1/cmek_config_service_pb.rb | 61 + .../v1/cmek_config_service_services_pb.rb | 55 + .../cloud/discoveryengine/v1/common_pb.rb | 56 + .../cloud/discoveryengine/v1/completion_pb.rb | 46 + .../v1/completion_service_pb.rb | 52 + .../v1/completion_service_services_pb.rb | 61 + .../cloud/discoveryengine/v1/control_pb.rb | 61 + .../discoveryengine/v1/control_service_pb.rb | 57 + .../v1/control_service_services_pb.rb | 69 + .../discoveryengine/v1/conversation_pb.rb | 54 + .../v1/conversational_search_service_pb.rb | 104 + ...nversational_search_service_services_pb.rb | 100 + .../v1/custom_tuning_model_pb.rb | 48 + .../cloud/discoveryengine/v1/data_store_pb.rb | 62 + .../v1/data_store_service_pb.rb | 62 + .../v1/data_store_service_services_pb.rb | 61 + .../cloud/discoveryengine/v1/document_pb.rb | 57 + .../v1/document_processing_config_pb.rb | 51 + .../discoveryengine/v1/document_service_pb.rb | 70 + .../v1/document_service_services_pb.rb | 83 + .../cloud/discoveryengine/v1/engine_pb.rb | 59 + .../discoveryengine/v1/engine_service_pb.rb | 62 + .../v1/engine_service_services_pb.rb | 55 + .../v1/grounded_generation_service_pb.rb | 79 + ...grounded_generation_service_services_pb.rb | 49 + .../cloud/discoveryengine/v1/grounding_pb.rb | 46 + .../v1/identity_mapping_store_pb.rb | 48 + .../v1/identity_mapping_store_service_pb.rb | 68 + ...ntity_mapping_store_service_services_pb.rb | 58 + .../discoveryengine/v1/import_config_pb.rb | 89 + .../cloud/discoveryengine/v1/project_pb.rb | 49 + .../discoveryengine/v1/project_service_pb.rb | 50 + .../v1/project_service_services_pb.rb | 51 + .../discoveryengine/v1/purge_config_pb.rb | 64 + .../discoveryengine/v1/rank_service_pb.rb | 49 + .../v1/rank_service_services_pb.rb | 45 + .../v1/recommendation_service_pb.rb | 55 + .../v1/recommendation_service_services_pb.rb | 45 + .../cloud/discoveryengine/v1/safety_pb.rb | 47 + .../cloud/discoveryengine/v1/schema_pb.rb | 47 + .../discoveryengine/v1/schema_service_pb.rb | 61 + .../v1/schema_service_services_pb.rb | 53 + .../discoveryengine/v1/search_service_pb.rb | 117 + .../v1/search_service_services_pb.rb | 59 + .../v1/search_tuning_service_pb.rb | 61 + .../v1/search_tuning_service_services_pb.rb | 47 + .../discoveryengine/v1/serving_config_pb.rb | 52 + .../v1/serving_config_service_pb.rb | 51 + .../v1/serving_config_service_services_pb.rb | 48 + .../cloud/discoveryengine/v1/session_pb.rb | 54 + .../discoveryengine/v1/session_service_pb.rb | 49 + .../v1/session_service_services_pb.rb | 64 + .../v1/site_search_engine_pb.rb | 55 + .../v1/site_search_engine_service_pb.rb | 91 + .../site_search_engine_service_services_pb.rb | 80 + .../cloud/discoveryengine/v1/user_event_pb.rb | 58 + .../v1/user_event_service_pb.rb | 54 + .../v1/user_event_service_services_pb.rb | 64 + .../discoveryengine/v1/user_license_pb.rb | 48 + .../v1/user_license_service_pb.rb | 61 + .../v1/user_license_service_services_pb.rb | 48 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/httpbody.rb | 80 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/discoveryengine/v1/answer.rb | 510 +++ .../cloud/discoveryengine/v1/assist_answer.rb | 278 ++ .../cloud/discoveryengine/v1/assistant.rb | 39 + .../discoveryengine/v1/assistant_service.rb | 207 + .../google/cloud/discoveryengine/v1/chunk.rb | 174 + .../discoveryengine/v1/cmek_config_service.rb | 222 + .../google/cloud/discoveryengine/v1/common.rb | 284 ++ .../cloud/discoveryengine/v1/completion.rb | 88 + .../discoveryengine/v1/completion_service.rb | 117 + .../cloud/discoveryengine/v1/control.rb | 339 ++ .../discoveryengine/v1/control_service.rb | 126 + .../cloud/discoveryengine/v1/conversation.rb | 119 + .../v1/conversational_search_service.rb | 982 +++++ .../discoveryengine/v1/custom_tuning_model.rb | 99 + .../cloud/discoveryengine/v1/data_store.rb | 288 ++ .../discoveryengine/v1/data_store_service.rb | 236 + .../cloud/discoveryengine/v1/document.rb | 245 ++ .../v1/document_processing_config.rb | 176 + .../discoveryengine/v1/document_service.rb | 313 ++ .../google/cloud/discoveryengine/v1/engine.rb | 371 ++ .../discoveryengine/v1/engine_service.rb | 177 + .../v1/grounded_generation_service.rb | 620 +++ .../cloud/discoveryengine/v1/grounding.rb | 88 + .../v1/identity_mapping_store.rb | 81 + .../v1/identity_mapping_store_service.rb | 279 ++ .../cloud/discoveryengine/v1/import_config.rb | 867 ++++ .../cloud/discoveryengine/v1/project.rb | 106 + .../discoveryengine/v1/project_service.rb | 57 + .../cloud/discoveryengine/v1/purge_config.rb | 293 ++ .../cloud/discoveryengine/v1/rank_service.rb | 126 + .../v1/recommendation_service.rb | 230 + .../google/cloud/discoveryengine/v1/safety.rb | 108 + .../google/cloud/discoveryengine/v1/schema.rb | 49 + .../discoveryengine/v1/schema_service.rb | 177 + .../discoveryengine/v1/search_service.rb | 1946 +++++++++ .../v1/search_tuning_service.rb | 172 + .../discoveryengine/v1/serving_config.rb | 261 ++ .../v1/serving_config_service.rb | 44 + .../cloud/discoveryengine/v1/session.rb | 134 + .../discoveryengine/v1/site_search_engine.rb | 186 + .../v1/site_search_engine_service.rb | 672 +++ .../cloud/discoveryengine/v1/user_event.rb | 548 +++ .../discoveryengine/v1/user_event_service.rb | 84 + .../cloud/discoveryengine/v1/user_license.rb | 85 + .../v1/user_license_service.rb | 153 + .../google/longrunning/operations.rb | 191 + .../proto_docs/google/protobuf/any.rb | 145 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/date.rb | 53 + .../snippets/Gemfile | 32 + .../assistant_service/stream_assist.rb | 50 + .../cmek_config_service/delete_cmek_config.rb | 54 + .../cmek_config_service/get_cmek_config.rb | 47 + .../cmek_config_service/list_cmek_configs.rb | 47 + .../cmek_config_service/update_cmek_config.rb | 54 + .../completion_service/complete_query.rb | 47 + .../import_completion_suggestions.rb | 54 + .../import_suggestion_deny_list_entries.rb | 54 + .../purge_completion_suggestions.rb | 54 + .../purge_suggestion_deny_list_entries.rb | 54 + .../control_service/create_control.rb | 47 + .../control_service/delete_control.rb | 47 + .../snippets/control_service/get_control.rb | 47 + .../snippets/control_service/list_controls.rb | 51 + .../control_service/update_control.rb | 47 + .../answer_query.rb | 47 + .../converse_conversation.rb | 47 + .../create_conversation.rb | 47 + .../create_session.rb | 47 + .../delete_conversation.rb | 47 + .../delete_session.rb | 47 + .../get_answer.rb | 47 + .../get_conversation.rb | 47 + .../get_session.rb | 47 + .../list_conversations.rb | 51 + .../list_sessions.rb | 51 + .../stream_answer_query.rb | 50 + .../update_conversation.rb | 47 + .../update_session.rb | 47 + .../data_store_service/create_data_store.rb | 54 + .../data_store_service/delete_data_store.rb | 54 + .../data_store_service/get_data_store.rb | 47 + .../data_store_service/list_data_stores.rb | 51 + .../data_store_service/update_data_store.rb | 47 + .../batch_get_documents_metadata.rb | 47 + .../document_service/create_document.rb | 47 + .../document_service/delete_document.rb | 47 + .../snippets/document_service/get_document.rb | 47 + .../document_service/import_documents.rb | 54 + .../document_service/list_documents.rb | 51 + .../document_service/purge_documents.rb | 54 + .../document_service/update_document.rb | 47 + .../snippets/engine_service/create_engine.rb | 54 + .../snippets/engine_service/delete_engine.rb | 54 + .../snippets/engine_service/get_engine.rb | 47 + .../snippets/engine_service/list_engines.rb | 51 + .../snippets/engine_service/update_engine.rb | 47 + .../check_grounding.rb | 47 + .../generate_grounded_content.rb | 47 + .../stream_generate_grounded_content.rb | 56 + .../create_identity_mapping_store.rb | 47 + .../delete_identity_mapping_store.rb | 54 + .../get_identity_mapping_store.rb | 47 + .../import_identity_mappings.rb | 54 + .../list_identity_mapping_stores.rb | 51 + .../list_identity_mappings.rb | 51 + .../purge_identity_mappings.rb | 54 + .../project_service/provision_project.rb | 54 + .../snippets/rank_service/rank.rb | 47 + .../recommendation_service/recommend.rb | 47 + .../snippets/schema_service/create_schema.rb | 54 + .../snippets/schema_service/delete_schema.rb | 54 + .../snippets/schema_service/get_schema.rb | 47 + .../snippets/schema_service/list_schemas.rb | 51 + .../snippets/schema_service/update_schema.rb | 54 + .../snippets/search_service/search.rb | 51 + .../snippets/search_service/search_lite.rb | 51 + .../list_custom_models.rb | 47 + .../train_custom_model.rb | 54 + .../update_serving_config.rb | 47 + .../session_service/create_session.rb | 47 + .../session_service/delete_session.rb | 47 + .../snippets/session_service/get_session.rb | 47 + .../snippets/session_service/list_sessions.rb | 51 + .../session_service/update_session.rb | 47 + .../batch_create_target_sites.rb | 54 + .../batch_verify_target_sites.rb | 54 + .../create_sitemap.rb | 54 + .../create_target_site.rb | 54 + .../delete_sitemap.rb | 54 + .../delete_target_site.rb | 54 + .../disable_advanced_site_search.rb | 54 + .../enable_advanced_site_search.rb | 54 + .../fetch_domain_verification_status.rb | 51 + .../fetch_sitemaps.rb | 47 + .../get_site_search_engine.rb | 47 + .../get_target_site.rb | 47 + .../list_target_sites.rb | 51 + .../recrawl_uris.rb | 54 + .../update_target_site.rb | 54 + ...adata_google.cloud.discoveryengine.v1.json | 3855 +++++++++++++++++ .../user_event_service/collect_user_event.rb | 47 + .../user_event_service/import_user_events.rb | 54 + .../user_event_service/purge_user_events.rb | 54 + .../user_event_service/write_user_event.rb | 47 + .../batch_update_user_licenses.rb | 54 + .../list_user_licenses.rb | 51 + .../v1/assistant_service_paths_test.rb | 88 + .../v1/assistant_service_rest_test.rb | 158 + .../v1/assistant_service_test.rb | 187 + .../v1/cmek_config_service_operations_test.rb | 400 ++ .../v1/cmek_config_service_paths_test.rb | 94 + .../v1/cmek_config_service_rest_test.rb | 316 ++ .../v1/cmek_config_service_test.rb | 362 ++ .../v1/completion_service_operations_test.rb | 400 ++ .../v1/completion_service_paths_test.rb | 58 + .../v1/completion_service_rest_test.rb | 376 ++ .../v1/completion_service_test.rb | 444 ++ .../v1/control_service_paths_test.rb | 103 + .../v1/control_service_rest_test.rb | 375 ++ .../v1/control_service_test.rb | 411 ++ ...onversational_search_service_paths_test.rb | 172 + ...conversational_search_service_rest_test.rb | 900 ++++ .../v1/conversational_search_service_test.rb | 1031 +++++ .../v1/data_store_service_operations_test.rb | 400 ++ .../v1/data_store_service_paths_test.rb | 151 + .../v1/data_store_service_rest_test.rb | 378 ++ .../v1/data_store_service_test.rb | 442 ++ .../v1/document_service_operations_test.rb | 400 ++ .../v1/document_service_paths_test.rb | 97 + .../v1/document_service_rest_test.rb | 549 +++ .../v1/document_service_test.rb | 635 +++ .../v1/engine_service_operations_test.rb | 400 ++ .../v1/engine_service_paths_test.rb | 67 + .../v1/engine_service_rest_test.rb | 375 ++ .../v1/engine_service_test.rb | 435 ++ .../grounded_generation_service_paths_test.rb | 85 + .../grounded_generation_service_rest_test.rb | 216 + .../v1/grounded_generation_service_test.rb | 336 ++ ...y_mapping_store_service_operations_test.rb | 400 ++ ...entity_mapping_store_service_paths_test.rb | 106 + ...dentity_mapping_store_service_rest_test.rb | 488 +++ .../v1/identity_mapping_store_service_test.rb | 575 +++ .../v1/project_service_operations_test.rb | 400 ++ .../v1/project_service_paths_test.rb | 55 + .../v1/project_service_rest_test.rb | 155 + .../v1/project_service_test.rb | 185 + .../v1/rank_service_paths_test.rb | 55 + .../v1/rank_service_rest_test.rb | 159 + .../discovery_engine/v1/rank_service_test.rb | 174 + .../v1/recommendation_service_paths_test.rb | 103 + .../v1/recommendation_service_rest_test.rb | 159 + .../v1/recommendation_service_test.rb | 174 + .../v1/schema_service_operations_test.rb | 400 ++ .../v1/schema_service_paths_test.rb | 73 + .../v1/schema_service_rest_test.rb | 374 ++ .../v1/schema_service_test.rb | 438 ++ .../v1/search_service_paths_test.rb | 109 + .../v1/search_service_rest_test.rb | 273 ++ .../v1/search_service_test.rb | 362 ++ .../search_tuning_service_operations_test.rb | 400 ++ .../v1/search_tuning_service_paths_test.rb | 58 + .../v1/search_tuning_service_rest_test.rb | 211 + .../v1/search_tuning_service_test.rb | 248 ++ .../v1/serving_config_service_paths_test.rb | 61 + .../v1/serving_config_service_rest_test.rb | 154 + .../v1/serving_config_service_test.rb | 164 + .../v1/session_service_paths_test.rb | 136 + .../v1/session_service_rest_test.rb | 376 ++ .../v1/session_service_test.rb | 413 ++ ...e_search_engine_service_operations_test.rb | 400 ++ .../site_search_engine_service_paths_test.rb | 88 + .../site_search_engine_service_rest_test.rb | 919 ++++ .../v1/site_search_engine_service_test.rb | 1068 +++++ .../v1/user_event_service_operations_test.rb | 400 ++ .../v1/user_event_service_paths_test.rb | 85 + .../v1/user_event_service_rest_test.rb | 324 ++ .../v1/user_event_service_test.rb | 382 ++ .../user_license_service_operations_test.rb | 400 ++ .../v1/user_license_service_paths_test.rb | 67 + .../v1/user_license_service_rest_test.rb | 212 + .../v1/user_license_service_test.rb | 255 ++ .../test/helper.rb | 25 + 489 files changed, 129754 insertions(+) create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/README.md create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/safety_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb create mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore b/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json new file mode 100644 index 000000000000..7f14e6eef777 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "discoveryengine.googleapis.com", + "api_shortname": "discoveryengine", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest", + "distribution_name": "google-cloud-discovery_engine-v1", + "is_cloud": true, + "language": "ruby", + "name": "discoveryengine", + "name_pretty": "Discovery Engine V1 API", + "product_documentation": "https://cloud.google.com/generative-ai-app-builder/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Discovery Engine API. Note that google-cloud-discovery_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-discovery_engine instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/generative-ai-app-builder/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml b/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml new file mode 100644 index 000000000000..56b31de04a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-discovery_engine-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-discovery_engine-v1.rb" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts b/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts new file mode 100644 index 000000000000..926c10b3d6c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Discovery Engine V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..9cc4fc80271b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-discovery_engine-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-discovery_engine-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/discovery_engine/v1" + +client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/discovery_engine/v1" + +::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-discovery_engine-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/discovery_engine/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile b/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md b/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/README.md b/owl-bot-staging/google-cloud-discovery_engine-v1/README.md new file mode 100644 index 000000000000..923b5e4740b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Discovery Engine V1 API + +Discovery Engine API. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Discovery Engine V1 API. Most users should consider using +the main client gem, +[google-cloud-discovery_engine](https://rubygems.org/gems/google-cloud-discovery_engine). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-discovery_engine-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/discoveryengine.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/discovery_engine/v1" + +client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new +request = ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new # (request fields as keyword arguments...) +response = client.search request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/generative-ai-app-builder/docs) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/discovery_engine/v1" +require "logger" + +client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-discovery_engine`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-discovery_engine-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-discovery_engine`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-discovery_engine-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile b/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile new file mode 100644 index 000000000000..38d5c794195b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-discovery_engine-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/discovery_engine/v1/search_service/credentials" + ::Google::Cloud::DiscoveryEngine::V1::SearchService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-discovery_engine-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-discovery_engine-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-discovery_engine-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-discovery_engine-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-discovery_engine-v1" + header "google-cloud-discovery_engine-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-discovery_engine-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-discovery_engine-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-discovery_engine-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-discovery_engine-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json new file mode 100644 index 000000000000..98ebe5c969da --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json @@ -0,0 +1,678 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.discoveryengine.v1", + "libraryPackage": "::Google::Cloud::DiscoveryEngine::V1", + "services": { + "SearchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client", + "rpcs": { + "Search": { + "methods": [ + "search" + ] + }, + "SearchLite": { + "methods": [ + "search_lite" + ] + } + } + } + } + }, + "AssistantService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client", + "rpcs": { + "StreamAssist": { + "methods": [ + "stream_assist" + ] + } + } + } + } + }, + "CmekConfigService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client", + "rpcs": { + "UpdateCmekConfig": { + "methods": [ + "update_cmek_config" + ] + }, + "GetCmekConfig": { + "methods": [ + "get_cmek_config" + ] + }, + "ListCmekConfigs": { + "methods": [ + "list_cmek_configs" + ] + }, + "DeleteCmekConfig": { + "methods": [ + "delete_cmek_config" + ] + } + } + } + } + }, + "CompletionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client", + "rpcs": { + "CompleteQuery": { + "methods": [ + "complete_query" + ] + }, + "ImportSuggestionDenyListEntries": { + "methods": [ + "import_suggestion_deny_list_entries" + ] + }, + "PurgeSuggestionDenyListEntries": { + "methods": [ + "purge_suggestion_deny_list_entries" + ] + }, + "ImportCompletionSuggestions": { + "methods": [ + "import_completion_suggestions" + ] + }, + "PurgeCompletionSuggestions": { + "methods": [ + "purge_completion_suggestions" + ] + } + } + } + } + }, + "ControlService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client", + "rpcs": { + "CreateControl": { + "methods": [ + "create_control" + ] + }, + "DeleteControl": { + "methods": [ + "delete_control" + ] + }, + "UpdateControl": { + "methods": [ + "update_control" + ] + }, + "GetControl": { + "methods": [ + "get_control" + ] + }, + "ListControls": { + "methods": [ + "list_controls" + ] + } + } + } + } + }, + "ConversationalSearchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client", + "rpcs": { + "ConverseConversation": { + "methods": [ + "converse_conversation" + ] + }, + "CreateConversation": { + "methods": [ + "create_conversation" + ] + }, + "DeleteConversation": { + "methods": [ + "delete_conversation" + ] + }, + "UpdateConversation": { + "methods": [ + "update_conversation" + ] + }, + "GetConversation": { + "methods": [ + "get_conversation" + ] + }, + "ListConversations": { + "methods": [ + "list_conversations" + ] + }, + "AnswerQuery": { + "methods": [ + "answer_query" + ] + }, + "StreamAnswerQuery": { + "methods": [ + "stream_answer_query" + ] + }, + "GetAnswer": { + "methods": [ + "get_answer" + ] + }, + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + }, + "UpdateSession": { + "methods": [ + "update_session" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + } + } + } + } + }, + "DataStoreService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client", + "rpcs": { + "CreateDataStore": { + "methods": [ + "create_data_store" + ] + }, + "GetDataStore": { + "methods": [ + "get_data_store" + ] + }, + "ListDataStores": { + "methods": [ + "list_data_stores" + ] + }, + "DeleteDataStore": { + "methods": [ + "delete_data_store" + ] + }, + "UpdateDataStore": { + "methods": [ + "update_data_store" + ] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client", + "rpcs": { + "GetDocument": { + "methods": [ + "get_document" + ] + }, + "ListDocuments": { + "methods": [ + "list_documents" + ] + }, + "CreateDocument": { + "methods": [ + "create_document" + ] + }, + "UpdateDocument": { + "methods": [ + "update_document" + ] + }, + "DeleteDocument": { + "methods": [ + "delete_document" + ] + }, + "ImportDocuments": { + "methods": [ + "import_documents" + ] + }, + "PurgeDocuments": { + "methods": [ + "purge_documents" + ] + }, + "BatchGetDocumentsMetadata": { + "methods": [ + "batch_get_documents_metadata" + ] + } + } + } + } + }, + "EngineService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client", + "rpcs": { + "CreateEngine": { + "methods": [ + "create_engine" + ] + }, + "DeleteEngine": { + "methods": [ + "delete_engine" + ] + }, + "UpdateEngine": { + "methods": [ + "update_engine" + ] + }, + "GetEngine": { + "methods": [ + "get_engine" + ] + }, + "ListEngines": { + "methods": [ + "list_engines" + ] + } + } + } + } + }, + "GroundedGenerationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client", + "rpcs": { + "StreamGenerateGroundedContent": { + "methods": [ + "stream_generate_grounded_content" + ] + }, + "GenerateGroundedContent": { + "methods": [ + "generate_grounded_content" + ] + }, + "CheckGrounding": { + "methods": [ + "check_grounding" + ] + } + } + } + } + }, + "IdentityMappingStoreService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client", + "rpcs": { + "CreateIdentityMappingStore": { + "methods": [ + "create_identity_mapping_store" + ] + }, + "GetIdentityMappingStore": { + "methods": [ + "get_identity_mapping_store" + ] + }, + "DeleteIdentityMappingStore": { + "methods": [ + "delete_identity_mapping_store" + ] + }, + "ImportIdentityMappings": { + "methods": [ + "import_identity_mappings" + ] + }, + "PurgeIdentityMappings": { + "methods": [ + "purge_identity_mappings" + ] + }, + "ListIdentityMappings": { + "methods": [ + "list_identity_mappings" + ] + }, + "ListIdentityMappingStores": { + "methods": [ + "list_identity_mapping_stores" + ] + } + } + } + } + }, + "ProjectService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client", + "rpcs": { + "ProvisionProject": { + "methods": [ + "provision_project" + ] + } + } + } + } + }, + "RankService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client", + "rpcs": { + "Rank": { + "methods": [ + "rank" + ] + } + } + } + } + }, + "RecommendationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client", + "rpcs": { + "Recommend": { + "methods": [ + "recommend" + ] + } + } + } + } + }, + "SchemaService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client", + "rpcs": { + "GetSchema": { + "methods": [ + "get_schema" + ] + }, + "ListSchemas": { + "methods": [ + "list_schemas" + ] + }, + "CreateSchema": { + "methods": [ + "create_schema" + ] + }, + "UpdateSchema": { + "methods": [ + "update_schema" + ] + }, + "DeleteSchema": { + "methods": [ + "delete_schema" + ] + } + } + } + } + }, + "SearchTuningService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client", + "rpcs": { + "TrainCustomModel": { + "methods": [ + "train_custom_model" + ] + }, + "ListCustomModels": { + "methods": [ + "list_custom_models" + ] + } + } + } + } + }, + "ServingConfigService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client", + "rpcs": { + "UpdateServingConfig": { + "methods": [ + "update_serving_config" + ] + } + } + } + } + }, + "SessionService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client", + "rpcs": { + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + }, + "UpdateSession": { + "methods": [ + "update_session" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + } + } + } + } + }, + "SiteSearchEngineService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client", + "rpcs": { + "GetSiteSearchEngine": { + "methods": [ + "get_site_search_engine" + ] + }, + "CreateTargetSite": { + "methods": [ + "create_target_site" + ] + }, + "BatchCreateTargetSites": { + "methods": [ + "batch_create_target_sites" + ] + }, + "GetTargetSite": { + "methods": [ + "get_target_site" + ] + }, + "UpdateTargetSite": { + "methods": [ + "update_target_site" + ] + }, + "DeleteTargetSite": { + "methods": [ + "delete_target_site" + ] + }, + "ListTargetSites": { + "methods": [ + "list_target_sites" + ] + }, + "CreateSitemap": { + "methods": [ + "create_sitemap" + ] + }, + "DeleteSitemap": { + "methods": [ + "delete_sitemap" + ] + }, + "FetchSitemaps": { + "methods": [ + "fetch_sitemaps" + ] + }, + "EnableAdvancedSiteSearch": { + "methods": [ + "enable_advanced_site_search" + ] + }, + "DisableAdvancedSiteSearch": { + "methods": [ + "disable_advanced_site_search" + ] + }, + "RecrawlUris": { + "methods": [ + "recrawl_uris" + ] + }, + "BatchVerifyTargetSites": { + "methods": [ + "batch_verify_target_sites" + ] + }, + "FetchDomainVerificationStatus": { + "methods": [ + "fetch_domain_verification_status" + ] + } + } + } + } + }, + "UserEventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client", + "rpcs": { + "WriteUserEvent": { + "methods": [ + "write_user_event" + ] + }, + "CollectUserEvent": { + "methods": [ + "collect_user_event" + ] + }, + "PurgeUserEvents": { + "methods": [ + "purge_user_events" + ] + }, + "ImportUserEvents": { + "methods": [ + "import_user_events" + ] + } + } + } + } + }, + "UserLicenseService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client", + "rpcs": { + "ListUserLicenses": { + "methods": [ + "list_user_licenses" + ] + }, + "BatchUpdateUserLicenses": { + "methods": [ + "batch_update_user_licenses" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec b/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec new file mode 100644 index 000000000000..94dabc53a975 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/discovery_engine/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-discovery_engine-v1" + gem.version = Google::Cloud::DiscoveryEngine::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Discovery Engine API. Note that google-cloud-discovery_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-discovery_engine instead. See the readme for more details." + gem.summary = "Discovery Engine API." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb new file mode 100644 index 000000000000..8fa7d6941140 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/discovery_engine/v1" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb new file mode 100644 index 000000000000..f81fdab2d80f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discovery_engine/v1/search_service" +require "google/cloud/discovery_engine/v1/assistant_service" +require "google/cloud/discovery_engine/v1/cmek_config_service" +require "google/cloud/discovery_engine/v1/completion_service" +require "google/cloud/discovery_engine/v1/control_service" +require "google/cloud/discovery_engine/v1/conversational_search_service" +require "google/cloud/discovery_engine/v1/data_store_service" +require "google/cloud/discovery_engine/v1/document_service" +require "google/cloud/discovery_engine/v1/engine_service" +require "google/cloud/discovery_engine/v1/grounded_generation_service" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service" +require "google/cloud/discovery_engine/v1/project_service" +require "google/cloud/discovery_engine/v1/rank_service" +require "google/cloud/discovery_engine/v1/recommendation_service" +require "google/cloud/discovery_engine/v1/schema_service" +require "google/cloud/discovery_engine/v1/search_tuning_service" +require "google/cloud/discovery_engine/v1/serving_config_service" +require "google/cloud/discovery_engine/v1/session_service" +require "google/cloud/discovery_engine/v1/site_search_engine_service" +require "google/cloud/discovery_engine/v1/user_event_service" +require "google/cloud/discovery_engine/v1/user_license_service" +require "google/cloud/discovery_engine/v1/version" + +module Google + module Cloud + module DiscoveryEngine + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/discovery_engine/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb new file mode 100644 index 000000000000..65a0bb155463 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/assistant_service/credentials" +require "google/cloud/discovery_engine/v1/assistant_service/paths" +require "google/cloud/discovery_engine/v1/assistant_service/client" +require "google/cloud/discovery_engine/v1/assistant_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Assistant configuration and assisting users. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/assistant_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/assistant_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new + # + module AssistantService + end + end + end + end +end + +helper_path = ::File.join __dir__, "assistant_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/assistant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb new file mode 100644 index 000000000000..6be46b957151 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb @@ -0,0 +1,526 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/assistant_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + ## + # Client for the AssistantService service. + # + # Service for managing Assistant configuration and assisting users. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :assistant_service_stub + + ## + # Configure the AssistantService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssistantService clients + # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.stream_assist.timeout = 300.0 + default_config.rpcs.stream_assist.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssistantService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @assistant_service_stub.universe_domain + end + + ## + # Create a new AssistantService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssistantService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/assistant_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @assistant_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @assistant_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @assistant_service_stub.endpoint + config.universe_domain = @assistant_service_stub.universe_domain + config.logger = @assistant_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @assistant_service_stub.logger + end + + # Service calls + + ## + # Assists the user with a query in a streaming fashion. + # + # @overload stream_assist(request, options = nil) + # Pass arguments to `stream_assist` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) + # Pass arguments to `stream_assist` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Optional. Current user query. + # + # Empty query is only supported if `file_ids` are provided. In this case, the + # answer will be generated based on those context files. + # @param session [::String] + # Optional. The session to use for the request. If specified, the assistant + # has access to the session history, and the query and the answer are stored + # there. + # + # If `-` is specified as the session ID, or it is left empty, then a new + # session is created with an automatically generated ID. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # @param user_metadata [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata, ::Hash] + # Optional. Information about the user initiating the query. + # @param tools_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec, ::Hash] + # Optional. Specification of tools that are used to serve the request. + # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec, ::Hash] + # Optional. Specification of the generation configuration for the request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new + # + # # Call the stream_assist method to start streaming. + # output = client.stream_assist request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_assist request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_assist.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_assist.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_assist.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @assistant_service_stub.call_rpc :stream_assist, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AssistantService API. + # + # This class represents the configuration for AssistantService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # stream_assist to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.stream_assist.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.stream_assist.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AssistantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `stream_assist` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_assist + + # @private + def initialize parent_rpcs = nil + stream_assist_config = parent_rpcs.stream_assist if parent_rpcs.respond_to? :stream_assist + @stream_assist = ::Gapic::Config::Method.new stream_assist_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb new file mode 100644 index 000000000000..65627bcdd468 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + # Credentials for the AssistantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb new file mode 100644 index 000000000000..fb4f8ab81803 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + # Path helper methods for the AssistantService API. + module Paths + ## + # Create a fully-qualified Assistant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param assistant [String] + # + # @return [::String] + def assistant_path project:, location:, collection:, engine:, assistant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/assistants/#{assistant}" + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, engine:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb new file mode 100644 index 000000000000..a576a15accd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/assistant_service/credentials" +require "google/cloud/discovery_engine/v1/assistant_service/paths" +require "google/cloud/discovery_engine/v1/assistant_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Assistant configuration and assisting users. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/assistant_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new + # + module AssistantService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/assistant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb new file mode 100644 index 000000000000..764caa95d50d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb @@ -0,0 +1,478 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/assistant_service_pb" +require "google/cloud/discovery_engine/v1/assistant_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + module Rest + ## + # REST client for the AssistantService service. + # + # Service for managing Assistant configuration and assisting users. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :assistant_service_stub + + ## + # Configure the AssistantService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AssistantService clients + # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.stream_assist.timeout = 300.0 + default_config.rpcs.stream_assist.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AssistantService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @assistant_service_stub.universe_domain + end + + ## + # Create a new AssistantService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AssistantService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @assistant_service_stub = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @assistant_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @assistant_service_stub.endpoint + config.universe_domain = @assistant_service_stub.universe_domain + config.logger = @assistant_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @assistant_service_stub.logger + end + + # Service calls + + ## + # Assists the user with a query in a streaming fashion. + # + # @overload stream_assist(request, options = nil) + # Pass arguments to `stream_assist` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) + # Pass arguments to `stream_assist` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Optional. Current user query. + # + # Empty query is only supported if `file_ids` are provided. In this case, the + # answer will be generated based on those context files. + # @param session [::String] + # Optional. The session to use for the request. If specified, the assistant + # has access to the session history, and the query and the answer are stored + # there. + # + # If `-` is specified as the session ID, or it is left empty, then a new + # session is created with an automatically generated ID. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # @param user_metadata [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata, ::Hash] + # Optional. Information about the user initiating the query. + # @param tools_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec, ::Hash] + # Optional. Specification of tools that are used to serve the request. + # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec, ::Hash] + # Optional. Specification of the generation configuration for the request. + # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new + # + # # Call the stream_assist method to start streaming. + # output = client.stream_assist request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_assist request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_assist.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_assist.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_assist.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @assistant_service_stub.stream_assist request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AssistantService REST API. + # + # This class represents the configuration for AssistantService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # stream_assist to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.stream_assist.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.stream_assist.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the AssistantService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `stream_assist` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_assist + + # @private + def initialize parent_rpcs = nil + stream_assist_config = parent_rpcs.stream_assist if parent_rpcs.respond_to? :stream_assist + @stream_assist = ::Gapic::Config::Method.new stream_assist_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb new file mode 100644 index 000000000000..9bbf582985b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/assistant_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + module Rest + ## + # REST service stub for the AssistantService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the stream_assist REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_assist(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_assist_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_assist", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_assist REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_assist_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:streamAssist", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/assistants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb new file mode 100644 index 000000000000..15a50496836b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/cmek_config_service/credentials" +require "google/cloud/discovery_engine/v1/cmek_config_service/paths" +require "google/cloud/discovery_engine/v1/cmek_config_service/operations" +require "google/cloud/discovery_engine/v1/cmek_config_service/client" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing CMEK related tasks + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/cmek_config_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/cmek_config_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + module CmekConfigService + end + end + end + end +end + +helper_path = ::File.join __dir__, "cmek_config_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/cmek_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb new file mode 100644 index 000000000000..a4d24b2e71f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb @@ -0,0 +1,820 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + ## + # Client for the CmekConfigService service. + # + # Service for managing CMEK related tasks + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cmek_config_service_stub + + ## + # Configure the CmekConfigService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CmekConfigService clients + # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CmekConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cmek_config_service_stub.universe_domain + end + + ## + # Create a new CmekConfigService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CmekConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/cmek_config_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cmek_config_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @cmek_config_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cmek_config_service_stub.endpoint + config.universe_domain = @cmek_config_service_stub.universe_domain + config.logger = @cmek_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cmek_config_service_stub.logger + end + + # Service calls + + ## + # Provisions a CMEK key for use in a location of a customer's project. + # This method will also conduct location validation on the provided + # cmekConfig to make sure the key is valid and can be used in the + # selected location. + # + # @overload update_cmek_config(request, options = nil) + # Pass arguments to `update_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_cmek_config(config: nil, set_default: nil) + # Pass arguments to `update_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::DiscoveryEngine::V1::CmekConfig, ::Hash] + # Required. The CmekConfig resource. + # @param set_default [::Boolean] + # Set the following CmekConfig as the default to be used for child + # resources if one is not specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new + # + # # Call the update_cmek_config method. + # result = client.update_cmek_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.config&.name + header_params["config.name"] = request.config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.call_rpc :update_cmek_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}. + # + # @overload get_cmek_config(request, options = nil) + # Pass arguments to `get_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cmek_config(name: nil) + # Pass arguments to `get_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as + # `projects/*/locations/*/cmekConfig` or + # `projects/*/locations/*/cmekConfigs/*`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new + # + # # Call the get_cmek_config method. + # result = client.get_cmek_config request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. + # p result + # + def get_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.call_rpc :get_cmek_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s + # with the project. + # + # @overload list_cmek_configs(request, options = nil) + # Pass arguments to `list_cmek_configs` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_cmek_configs(parent: nil) + # Pass arguments to `list_cmek_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent location resource name, such as + # `projects/{project}/locations/{location}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this + # location, regardless of whether or not a CmekConfig exists, a + # PERMISSION_DENIED error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new + # + # # Call the list_cmek_configs method. + # result = client.list_cmek_configs request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. + # p result + # + def list_cmek_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_cmek_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_cmek_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_cmek_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.call_rpc :list_cmek_configs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # De-provisions a CmekConfig. + # + # @overload delete_cmek_config(request, options = nil) + # Pass arguments to `delete_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_cmek_config(name: nil) + # Pass arguments to `delete_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new + # + # # Call the delete_cmek_config method. + # result = client.delete_cmek_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_cmek_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.call_rpc :delete_cmek_config, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CmekConfigService API. + # + # This class represents the configuration for CmekConfigService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_cmek_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_cmek_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_cmek_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CmekConfigService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cmek_config + ## + # RPC-specific configuration for `get_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cmek_config + ## + # RPC-specific configuration for `list_cmek_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cmek_configs + ## + # RPC-specific configuration for `delete_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cmek_config + + # @private + def initialize parent_rpcs = nil + update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config + @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config + get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config + @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config + list_cmek_configs_config = parent_rpcs.list_cmek_configs if parent_rpcs.respond_to? :list_cmek_configs + @list_cmek_configs = ::Gapic::Config::Method.new list_cmek_configs_config + delete_cmek_config_config = parent_rpcs.delete_cmek_config if parent_rpcs.respond_to? :delete_cmek_config + @delete_cmek_config = ::Gapic::Config::Method.new delete_cmek_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb new file mode 100644 index 000000000000..c19fdc397905 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + # Credentials for the CmekConfigService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb new file mode 100644 index 000000000000..7e46827be9d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CmekConfigService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CmekConfigService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb new file mode 100644 index 000000000000..a3f240d94c6e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + # Path helper methods for the CmekConfigService API. + module Paths + ## + # Create a fully-qualified CmekConfig resource string. + # + # @overload cmek_config_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfig` + # + # @param project [String] + # @param location [String] + # + # @overload cmek_config_path(project:, location:, cmek_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` + # + # @param project [String] + # @param location [String] + # @param cmek_config [String] + # + # @return [::String] + def cmek_config_path **args + resources = { + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfig" + end), + "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified CryptoKeyVersions resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified CryptoKeys resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_keys_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb new file mode 100644 index 000000000000..d1897c55899f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/cmek_config_service/credentials" +require "google/cloud/discovery_engine/v1/cmek_config_service/paths" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest/operations" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing CMEK related tasks + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/cmek_config_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + module CmekConfigService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb new file mode 100644 index 000000000000..f0dff4b94886 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb @@ -0,0 +1,749 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + module Rest + ## + # REST client for the CmekConfigService service. + # + # Service for managing CMEK related tasks + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cmek_config_service_stub + + ## + # Configure the CmekConfigService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CmekConfigService clients + # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CmekConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cmek_config_service_stub.universe_domain + end + + ## + # Create a new CmekConfigService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CmekConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cmek_config_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cmek_config_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cmek_config_service_stub.endpoint + config.universe_domain = @cmek_config_service_stub.universe_domain + config.logger = @cmek_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cmek_config_service_stub.logger + end + + # Service calls + + ## + # Provisions a CMEK key for use in a location of a customer's project. + # This method will also conduct location validation on the provided + # cmekConfig to make sure the key is valid and can be used in the + # selected location. + # + # @overload update_cmek_config(request, options = nil) + # Pass arguments to `update_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_cmek_config(config: nil, set_default: nil) + # Pass arguments to `update_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param config [::Google::Cloud::DiscoveryEngine::V1::CmekConfig, ::Hash] + # Required. The CmekConfig resource. + # @param set_default [::Boolean] + # Set the following CmekConfig as the default to be used for child + # resources if one is not specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new + # + # # Call the update_cmek_config method. + # result = client.update_cmek_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.update_cmek_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}. + # + # @overload get_cmek_config(request, options = nil) + # Pass arguments to `get_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cmek_config(name: nil) + # Pass arguments to `get_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as + # `projects/*/locations/*/cmekConfig` or + # `projects/*/locations/*/cmekConfigs/*`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new + # + # # Call the get_cmek_config method. + # result = client.get_cmek_config request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. + # p result + # + def get_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.get_cmek_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s + # with the project. + # + # @overload list_cmek_configs(request, options = nil) + # Pass arguments to `list_cmek_configs` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_cmek_configs(parent: nil) + # Pass arguments to `list_cmek_configs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent location resource name, such as + # `projects/{project}/locations/{location}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this + # location, regardless of whether or not a CmekConfig exists, a + # PERMISSION_DENIED error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new + # + # # Call the list_cmek_configs method. + # result = client.list_cmek_configs request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. + # p result + # + def list_cmek_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_cmek_configs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_cmek_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_cmek_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.list_cmek_configs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # De-provisions a CmekConfig. + # + # @overload delete_cmek_config(request, options = nil) + # Pass arguments to `delete_cmek_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_cmek_config(name: nil) + # Pass arguments to `delete_cmek_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new + # + # # Call the delete_cmek_config method. + # result = client.delete_cmek_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cmek_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_cmek_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_cmek_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cmek_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cmek_config_service_stub.delete_cmek_config request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CmekConfigService REST API. + # + # This class represents the configuration for CmekConfigService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_cmek_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_cmek_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_cmek_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CmekConfigService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cmek_config + ## + # RPC-specific configuration for `get_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cmek_config + ## + # RPC-specific configuration for `list_cmek_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cmek_configs + ## + # RPC-specific configuration for `delete_cmek_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cmek_config + + # @private + def initialize parent_rpcs = nil + update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config + @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config + get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config + @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config + list_cmek_configs_config = parent_rpcs.list_cmek_configs if parent_rpcs.respond_to? :list_cmek_configs + @list_cmek_configs = ::Gapic::Config::Method.new list_cmek_configs_config + delete_cmek_config_config = parent_rpcs.delete_cmek_config if parent_rpcs.respond_to? :delete_cmek_config + @delete_cmek_config = ::Gapic::Config::Method.new delete_cmek_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb new file mode 100644 index 000000000000..ca012489ef25 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CmekConfigService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CmekConfigService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb new file mode 100644 index 000000000000..a0f74c0359bd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb @@ -0,0 +1,341 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + module Rest + ## + # REST service stub for the CmekConfigService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the update_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_cmek_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cmek_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_cmek_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # A result object deserialized from the server's reply + def get_cmek_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cmek_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cmek_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_cmek_configs REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] + # A result object deserialized from the server's reply + def list_cmek_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_cmek_configs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_cmek_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_cmek_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cmek_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_cmek_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_cmek_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{config.name}", + body: "config", + matches: [ + ["config.name", %r{^projects/[^/]+/locations/[^/]+/cmekConfig/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{config.name}", + body: "config", + matches: [ + ["config.name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cmek_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfig/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_cmek_configs REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_cmek_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cmekConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cmek_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_cmek_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb new file mode 100644 index 000000000000..46fd292280fb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/completion_service/credentials" +require "google/cloud/discovery_engine/v1/completion_service/paths" +require "google/cloud/discovery_engine/v1/completion_service/operations" +require "google/cloud/discovery_engine/v1/completion_service/client" +require "google/cloud/discovery_engine/v1/completion_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for Auto-Completion. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/completion_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/completion_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + module CompletionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "completion_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/completion_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb new file mode 100644 index 000000000000..913bf9bfb8f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb @@ -0,0 +1,1000 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/completion_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + ## + # Client for the CompletionService service. + # + # Service for Auto-Completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_service_stub + + ## + # Configure the CompletionService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompletionService clients + # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_service_stub.universe_domain + end + + ## + # Create a new CompletionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompletionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/completion_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @completion_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @completion_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + config.logger = @completion_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_service_stub.logger + end + + # Service calls + + ## + # Completes the specified user input with keyword suggestions. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_query(data_store: nil, query: nil, query_model: nil, user_pseudo_id: nil, include_tail_suggestions: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::String] + # 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`. + # @param query [::String] + # Required. The typeahead input used to fetch suggestions. Maximum length is + # 128 characters. + # @param query_model [::String] + # Specifies the autocomplete data model. This overrides any model specified + # in the Configuration > Autocomplete section of the Cloud console. Currently + # supported values: + # + # * `document` - Using suggestions generated from user-imported documents. + # * `search-history` - Using suggestions generated from the past history of + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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. + # @param user_pseudo_id [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. + # @param include_tail_suggestions [::Boolean] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.complete_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.data_store + header_params["data_store"] = request.data_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.complete_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :complete_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports all + # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} + # for a DataStore. + # + # @overload import_suggestion_deny_list_entries(request, options = nil) + # Pass arguments to `import_suggestion_deny_list_entries` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_suggestion_deny_list_entries(inline_source: nil, gcs_source: nil, parent: nil) + # Pass arguments to `import_suggestion_deny_list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash] + # The Inline source for the input content for suggestion deny list entries. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Only 1 file can be specified that contains all entries to import. + # Supported values `gcs_source.schema` for autocomplete suggestion deny + # list entry imports: + # + # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] + # per line. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new + # + # # Call the import_suggestion_deny_list_entries method. + # result = client.import_suggestion_deny_list_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_suggestion_deny_list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_suggestion_deny_list_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_suggestion_deny_list_entries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_suggestion_deny_list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :import_suggestion_deny_list_entries, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all + # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} + # for a DataStore. + # + # @overload purge_suggestion_deny_list_entries(request, options = nil) + # Pass arguments to `purge_suggestion_deny_list_entries` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_suggestion_deny_list_entries(parent: nil) + # Pass arguments to `purge_suggestion_deny_list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new + # + # # Call the purge_suggestion_deny_list_entries method. + # result = client.purge_suggestion_deny_list_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_suggestion_deny_list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.purge_suggestion_deny_list_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.purge_suggestion_deny_list_entries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_suggestion_deny_list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :purge_suggestion_deny_list_entries, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # for a DataStore. + # + # @overload import_completion_suggestions(request, options = nil) + # Pass arguments to `import_completion_suggestions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) + # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash] + # The Inline source for suggestion entries. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent data store resource name for which to import customer + # autocomplete suggestions. + # + # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new + # + # # Call the import_completion_suggestions method. + # result = client.import_completion_suggestions request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_completion_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_completion_suggestions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_completion_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :import_completion_suggestions, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # for a DataStore. + # + # @overload purge_completion_suggestions(request, options = nil) + # Pass arguments to `purge_completion_suggestions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_completion_suggestions(parent: nil) + # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name for which to purge completion + # suggestions. Follows pattern + # projects/*/locations/*/collections/*/dataStores/*. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new + # + # # Call the purge_completion_suggestions method. + # result = client.purge_completion_suggestions request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_completion_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.call_rpc :purge_completion_suggestions, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompletionService API. + # + # This class represents the configuration for CompletionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the CompletionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + ## + # RPC-specific configuration for `import_suggestion_deny_list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :import_suggestion_deny_list_entries + ## + # RPC-specific configuration for `purge_suggestion_deny_list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_suggestion_deny_list_entries + ## + # RPC-specific configuration for `import_completion_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :import_completion_suggestions + ## + # RPC-specific configuration for `purge_completion_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_completion_suggestions + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries + @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config + purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries + @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config + import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions + @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config + purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions + @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb new file mode 100644 index 000000000000..527b10cfb665 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + # Credentials for the CompletionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb new file mode 100644 index 000000000000..3e1f3291610e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CompletionService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb new file mode 100644 index 000000000000..4f9715b1085b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + # Path helper methods for the CompletionService API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb new file mode 100644 index 000000000000..f283ce19f263 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/completion_service/credentials" +require "google/cloud/discovery_engine/v1/completion_service/paths" +require "google/cloud/discovery_engine/v1/completion_service/rest/operations" +require "google/cloud/discovery_engine/v1/completion_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for Auto-Completion. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/completion_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + module CompletionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/completion_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb new file mode 100644 index 000000000000..e590c85b788b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb @@ -0,0 +1,922 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/completion_service_pb" +require "google/cloud/discovery_engine/v1/completion_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + module Rest + ## + # REST client for the CompletionService service. + # + # Service for Auto-Completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_service_stub + + ## + # Configure the CompletionService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompletionService clients + # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @completion_service_stub.universe_domain + end + + ## + # Create a new CompletionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompletionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @completion_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @completion_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @completion_service_stub.endpoint + config.universe_domain = @completion_service_stub.universe_domain + config.logger = @completion_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_service_stub.logger + end + + # Service calls + + ## + # Completes the specified user input with keyword suggestions. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_query(data_store: nil, query: nil, query_model: nil, user_pseudo_id: nil, include_tail_suggestions: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::String] + # 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`. + # @param query [::String] + # Required. The typeahead input used to fetch suggestions. Maximum length is + # 128 characters. + # @param query_model [::String] + # Specifies the autocomplete data model. This overrides any model specified + # in the Configuration > Autocomplete section of the Cloud console. Currently + # supported values: + # + # * `document` - Using suggestions generated from user-imported documents. + # * `search-history` - Using suggestions generated from the past history of + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search 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. + # @param user_pseudo_id [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. + # @param include_tail_suggestions [::Boolean] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.complete_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.complete_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.complete_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports all + # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} + # for a DataStore. + # + # @overload import_suggestion_deny_list_entries(request, options = nil) + # Pass arguments to `import_suggestion_deny_list_entries` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_suggestion_deny_list_entries(inline_source: nil, gcs_source: nil, parent: nil) + # Pass arguments to `import_suggestion_deny_list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash] + # The Inline source for the input content for suggestion deny list entries. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Only 1 file can be specified that contains all entries to import. + # Supported values `gcs_source.schema` for autocomplete suggestion deny + # list entry imports: + # + # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] + # per line. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new + # + # # Call the import_suggestion_deny_list_entries method. + # result = client.import_suggestion_deny_list_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_suggestion_deny_list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_suggestion_deny_list_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_suggestion_deny_list_entries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_suggestion_deny_list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.import_suggestion_deny_list_entries request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all + # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} + # for a DataStore. + # + # @overload purge_suggestion_deny_list_entries(request, options = nil) + # Pass arguments to `purge_suggestion_deny_list_entries` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_suggestion_deny_list_entries(parent: nil) + # Pass arguments to `purge_suggestion_deny_list_entries` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new + # + # # Call the purge_suggestion_deny_list_entries method. + # result = client.purge_suggestion_deny_list_entries request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_suggestion_deny_list_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.purge_suggestion_deny_list_entries.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_suggestion_deny_list_entries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_suggestion_deny_list_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.purge_suggestion_deny_list_entries request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # for a DataStore. + # + # @overload import_completion_suggestions(request, options = nil) + # Pass arguments to `import_completion_suggestions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) + # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash] + # The Inline source for suggestion entries. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent data store resource name for which to import customer + # autocomplete suggestions. + # + # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new + # + # # Call the import_completion_suggestions method. + # result = client.import_completion_suggestions request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_completion_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_completion_suggestions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_completion_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.import_completion_suggestions request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # for a DataStore. + # + # @overload purge_completion_suggestions(request, options = nil) + # Pass arguments to `purge_completion_suggestions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_completion_suggestions(parent: nil) + # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name for which to purge completion + # suggestions. Follows pattern + # projects/*/locations/*/collections/*/dataStores/*. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new + # + # # Call the purge_completion_suggestions method. + # result = client.purge_completion_suggestions request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_completion_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_service_stub.purge_completion_suggestions request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompletionService REST API. + # + # This class represents the configuration for CompletionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the CompletionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + ## + # RPC-specific configuration for `import_suggestion_deny_list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :import_suggestion_deny_list_entries + ## + # RPC-specific configuration for `purge_suggestion_deny_list_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_suggestion_deny_list_entries + ## + # RPC-specific configuration for `import_completion_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :import_completion_suggestions + ## + # RPC-specific configuration for `purge_completion_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_completion_suggestions + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries + @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config + purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries + @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config + import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions + @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config + purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions + @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb new file mode 100644 index 000000000000..84b0beca2122 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the CompletionService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the CompletionService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb new file mode 100644 index 000000000000..21c87e44ff21 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/completion_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + module Rest + ## + # REST service stub for the CompletionService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the complete_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] + # A result object deserialized from the server's reply + def complete_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "complete_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_suggestion_deny_list_entries REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_suggestion_deny_list_entries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_suggestion_deny_list_entries_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_suggestion_deny_list_entries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_suggestion_deny_list_entries REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def purge_suggestion_deny_list_entries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_suggestion_deny_list_entries_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "purge_suggestion_deny_list_entries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_completion_suggestions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_completion_suggestions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_completion_suggestions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_completion_suggestions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_completion_suggestions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def purge_completion_suggestions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_completion_suggestions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "purge_completion_suggestions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{data_store}:completeQuery", + matches: [ + ["data_store", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{data_store}:completeQuery", + matches: [ + ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_suggestion_deny_list_entries REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_suggestion_deny_list_entries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/suggestionDenyListEntries:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/suggestionDenyListEntries:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_suggestion_deny_list_entries REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_suggestion_deny_list_entries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/suggestionDenyListEntries:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/suggestionDenyListEntries:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_completion_suggestions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_completion_suggestions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/completionSuggestions:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/completionSuggestions:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_completion_suggestions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_completion_suggestions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/completionSuggestions:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/completionSuggestions:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb new file mode 100644 index 000000000000..9613d6b89910 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/control_service/credentials" +require "google/cloud/discovery_engine/v1/control_service/paths" +require "google/cloud/discovery_engine/v1/control_service/client" +require "google/cloud/discovery_engine/v1/control_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for performing CRUD operations on Controls. + # Controls allow for custom logic to be implemented in the serving path. + # Controls need to be attached to a Serving Config to be considered during a + # request. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/control_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/control_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + module ControlService + end + end + end + end +end + +helper_path = ::File.join __dir__, "control_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/control_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb new file mode 100644 index 000000000000..c1e892c4e02a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb @@ -0,0 +1,922 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/control_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + ## + # Client for the ControlService service. + # + # Service for performing CRUD operations on Controls. + # Controls allow for custom logic to be implemented in the serving path. + # Controls need to be attached to a Serving Config to be considered during a + # request. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :control_service_stub + + ## + # Configure the ControlService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ControlService clients + # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ControlService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @control_service_stub.universe_domain + end + + ## + # Create a new ControlService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ControlService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/control_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @control_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @control_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + config.logger = @control_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @control_service_stub.logger + end + + # Service calls + + ## + # Creates a Control. + # + # By default 1000 controls are allowed for a data store. + # A request can be submitted to adjust this limit. + # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_control(request, options = nil) + # Pass arguments to `create_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_control(parent: nil, control: nil, control_id: nil) + # Pass arguments to `create_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] + # Required. The Control to create. + # @param control_id [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value must be within 1-63 characters. + # Valid characters are /[a-z][0-9]-_/. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new + # + # # Call the create_control method. + # result = client.create_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def create_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :create_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Control. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_control(request, options = nil) + # Pass arguments to `delete_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_control(name: nil) + # Pass arguments to `delete_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new + # + # # Call the delete_control method. + # result = client.delete_control request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :delete_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Control. + # + # {::Google::Cloud::DiscoveryEngine::V1::Control Control} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_control(request, options = nil) + # Pass arguments to `update_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_control(control: nil, update_mask: nil) + # Pass arguments to `update_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] + # Required. The Control to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} + # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new + # + # # Call the update_control method. + # result = client.update_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def update_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.control&.name + header_params["control.name"] = request.control.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :update_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Control. + # + # @overload get_control(request, options = nil) + # Pass arguments to `get_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_control(name: nil) + # Pass arguments to `get_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new + # + # # Call the get_control method. + # result = client.get_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def get_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_control.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :get_control, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Controls by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_controls(request, options = nil) + # Pass arguments to `list_controls` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_controls` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is + # unset. Currently this field is unsupported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new + # + # # Call the list_controls method. + # result = client.list_controls request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. + # p item + # end + # + def list_controls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_controls.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_controls.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_controls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.call_rpc :list_controls, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @control_service_stub, :list_controls, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ControlService API. + # + # This class represents the configuration for ControlService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_control to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ControlService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_control` + # @return [::Gapic::Config::Method] + # + attr_reader :create_control + ## + # RPC-specific configuration for `delete_control` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_control + ## + # RPC-specific configuration for `update_control` + # @return [::Gapic::Config::Method] + # + attr_reader :update_control + ## + # RPC-specific configuration for `get_control` + # @return [::Gapic::Config::Method] + # + attr_reader :get_control + ## + # RPC-specific configuration for `list_controls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_controls + + # @private + def initialize parent_rpcs = nil + create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control + @create_control = ::Gapic::Config::Method.new create_control_config + delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control + @delete_control = ::Gapic::Config::Method.new delete_control_config + update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control + @update_control = ::Gapic::Config::Method.new update_control_config + get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control + @get_control = ::Gapic::Config::Method.new get_control_config + list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls + @list_controls = ::Gapic::Config::Method.new list_controls_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb new file mode 100644 index 000000000000..d50a1fa0c1d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + # Credentials for the ControlService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb new file mode 100644 index 000000000000..c812b764bd0a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb @@ -0,0 +1,220 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + # Path helper methods for the ControlService API. + module Paths + ## + # Create a fully-qualified Control resource string. + # + # @overload control_path(project:, location:, data_store:, control:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param control [String] + # + # @overload control_path(project:, location:, collection:, data_store:, control:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param control [String] + # + # @overload control_path(project:, location:, collection:, engine:, control:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param control [String] + # + # @return [::String] + def control_path **args + resources = { + "control:data_store:location:project" => (proc do |project:, location:, data_store:, control:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/controls/#{control}" + end), + "collection:control:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, control:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/controls/#{control}" + end), + "collection:control:engine:location:project" => (proc do |project:, location:, collection:, engine:, control:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/controls/#{control}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Engine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # + # @return [::String] + def engine_path project:, location:, collection:, engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb new file mode 100644 index 000000000000..ea18df587272 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/control_service/credentials" +require "google/cloud/discovery_engine/v1/control_service/paths" +require "google/cloud/discovery_engine/v1/control_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for performing CRUD operations on Controls. + # Controls allow for custom logic to be implemented in the serving path. + # Controls need to be attached to a Serving Config to be considered during a + # request. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/control_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + module ControlService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/control_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb new file mode 100644 index 000000000000..072b70f4c605 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb @@ -0,0 +1,844 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/control_service_pb" +require "google/cloud/discovery_engine/v1/control_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + module Rest + ## + # REST client for the ControlService service. + # + # Service for performing CRUD operations on Controls. + # Controls allow for custom logic to be implemented in the serving path. + # Controls need to be attached to a Serving Config to be considered during a + # request. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :control_service_stub + + ## + # Configure the ControlService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ControlService clients + # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ControlService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @control_service_stub.universe_domain + end + + ## + # Create a new ControlService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ControlService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @control_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @control_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @control_service_stub.endpoint + config.universe_domain = @control_service_stub.universe_domain + config.logger = @control_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @control_service_stub.logger + end + + # Service calls + + ## + # Creates a Control. + # + # By default 1000 controls are allowed for a data store. + # A request can be submitted to adjust this limit. + # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_control(request, options = nil) + # Pass arguments to `create_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_control(parent: nil, control: nil, control_id: nil) + # Pass arguments to `create_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] + # Required. The Control to create. + # @param control_id [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value must be within 1-63 characters. + # Valid characters are /[a-z][0-9]-_/. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new + # + # # Call the create_control method. + # result = client.create_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def create_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.create_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Control. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_control(request, options = nil) + # Pass arguments to `delete_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_control(name: nil) + # Pass arguments to `delete_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new + # + # # Call the delete_control method. + # result = client.delete_control request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.delete_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Control. + # + # {::Google::Cloud::DiscoveryEngine::V1::Control Control} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_control(request, options = nil) + # Pass arguments to `update_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_control(control: nil, update_mask: nil) + # Pass arguments to `update_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] + # Required. The Control to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} + # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new + # + # # Call the update_control method. + # result = client.update_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def update_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.update_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Control. + # + # @overload get_control(request, options = nil) + # Pass arguments to `get_control` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetControlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_control(name: nil) + # Pass arguments to `get_control` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new + # + # # Call the get_control method. + # result = client.get_control request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + # p result + # + def get_control request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_control.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_control.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_control.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.get_control request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Controls by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_controls(request, options = nil) + # Pass arguments to `list_controls` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_controls` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @param page_size [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is + # unset. Currently this field is unsupported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new + # + # # Call the list_controls method. + # result = client.list_controls request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. + # p item + # end + # + def list_controls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_controls.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_controls.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_controls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @control_service_stub.list_controls request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @control_service_stub, :list_controls, "controls", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ControlService REST API. + # + # This class represents the configuration for ControlService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_control to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_control.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ControlService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_control` + # @return [::Gapic::Config::Method] + # + attr_reader :create_control + ## + # RPC-specific configuration for `delete_control` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_control + ## + # RPC-specific configuration for `update_control` + # @return [::Gapic::Config::Method] + # + attr_reader :update_control + ## + # RPC-specific configuration for `get_control` + # @return [::Gapic::Config::Method] + # + attr_reader :get_control + ## + # RPC-specific configuration for `list_controls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_controls + + # @private + def initialize parent_rpcs = nil + create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control + @create_control = ::Gapic::Config::Method.new create_control_config + delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control + @delete_control = ::Gapic::Config::Method.new delete_control_config + update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control + @update_control = ::Gapic::Config::Method.new update_control_config + get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control + @get_control = ::Gapic::Config::Method.new get_control_config + list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls + @list_controls = ::Gapic::Config::Method.new list_controls_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb new file mode 100644 index 000000000000..fb345d714714 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/control_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + module Rest + ## + # REST service stub for the ControlService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # A result object deserialized from the server's reply + def create_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_control_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_control_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # A result object deserialized from the server's reply + def update_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_control_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # A result object deserialized from the server's reply + def get_control request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_control_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_control", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_controls REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse] + # A result object deserialized from the server's reply + def list_controls request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_controls_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_controls", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/controls", + body: "control", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/controls", + body: "control", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/controls", + body: "control", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{control.name}", + body: "control", + matches: [ + ["control.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{control.name}", + body: "control", + matches: [ + ["control.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{control.name}", + body: "control", + matches: [ + ["control.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_control REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_control_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_controls REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_controls_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/controls", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/controls", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/controls", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb new file mode 100644 index 000000000000..aaaf9bd740ea --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/conversational_search_service/credentials" +require "google/cloud/discovery_engine/v1/conversational_search_service/paths" +require "google/cloud/discovery_engine/v1/conversational_search_service/client" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for conversational search. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/conversational_search_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/conversational_search_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + module ConversationalSearchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversational_search_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/conversational_search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb new file mode 100644 index 000000000000..ea00baceaec3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb @@ -0,0 +1,2026 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/conversational_search_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + ## + # Client for the ConversationalSearchService service. + # + # Service for conversational search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversational_search_service_stub + + ## + # Configure the ConversationalSearchService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationalSearchService clients + # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationalSearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversational_search_service_stub.universe_domain + end + + ## + # Create a new ConversationalSearchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationalSearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/conversational_search_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversational_search_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @conversational_search_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @conversational_search_service_stub.logger + end + + # Service calls + + ## + # Converses a conversation. + # + # @overload converse_conversation(request, options = nil) + # Pass arguments to `converse_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) + # Pass arguments to `converse_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + # Use + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + # to activate auto session mode, which automatically creates a new + # conversation inside a ConverseConversation session. + # @param query [::Google::Cloud::DiscoveryEngine::V1::TextInput, ::Hash] + # Required. Current user input. + # @param serving_config [::String] + # The resource name of the Serving Config to use. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + # If this is not set, the default serving config will be used. + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # 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. + # @param safe_search [::Boolean] + # Whether to turn on safe search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param summary_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec, ::Hash] + # A specification for configuring the summary returned in the response. + # @param filter [::String] + # 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. This will be used to filter search results + # which may affect the summary response. + # + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents in search results which may + # affect the converse response. For more information on boosting, see + # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new + # + # # Call the converse_conversation method. + # result = client.converse_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. + # p result + # + def converse_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.converse_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.converse_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.converse_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :converse_conversation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Conversation. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to + # create already exists, an ALREADY_EXISTS error is returned. + # + # @overload create_conversation(request, options = nil) + # Pass arguments to `create_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_conversation(parent: nil, conversation: nil) + # Pass arguments to `create_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # Required. The conversation to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def create_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :create_conversation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Conversation. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to + # delete does not exist, a NOT_FOUND error is returned. + # + # @overload delete_conversation(request, options = nil) + # Pass arguments to `delete_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_conversation(name: nil) + # Pass arguments to `delete_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new + # + # # Call the delete_conversation method. + # result = client.delete_conversation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :delete_conversation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Conversation. + # + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} action type + # cannot be changed. If the + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update does + # not exist, a NOT_FOUND error is returned. + # + # @overload update_conversation(request, options = nil) + # Pass arguments to `update_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_conversation(conversation: nil, update_mask: nil) + # Pass arguments to `update_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # Required. The Conversation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new + # + # # Call the update_conversation method. + # result = client.update_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def update_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.conversation&.name + header_params["conversation.name"] = request.conversation.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :update_conversation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Conversation. + # + # @overload get_conversation(request, options = nil) + # Pass arguments to `get_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_conversation(name: nil) + # Pass arguments to `get_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def get_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :get_conversation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Conversations by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_conversations(request, options = nil) + # Pass arguments to `list_conversations` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_conversations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListConversations` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A filter to apply on the list results. The supported features are: + # user_pseudo_id, state. + # + # Example: + # "user_pseudo_id = some_id" + # @param order_by [::String] + # 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" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new + # + # # Call the list_conversations method. + # result = client.list_conversations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. + # p item + # end + # + def list_conversations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_conversations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_conversations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_conversations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :list_conversations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Answer query method. + # + # @overload answer_query(request, options = nil) + # Pass arguments to `answer_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) + # Pass arguments to `answer_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + # This field is used to identify the serving configuration name, set + # of models used to make the search. + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Required. Current user query. + # @param session [::String] + # The session resource name. Not required. + # + # When session field is not set, the API is in sessionless mode. + # + # We support auto session mode: users can use the wildcard symbol `-` as + # session ID. A new ID will be automatically generated and assigned. + # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] + # Model specification. + # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] + # Related questions specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] + # Optional. Grounding specification. + # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] + # Answer generation specification. + # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] + # Search specification. + # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] + # Query understanding specification. + # @param asynchronous_mode [::Boolean] + # Deprecated: This field is deprecated. Streaming Answer API will be + # supported. + # + # Asynchronous mode control. + # + # If enabled, the response will be returned with answer/session resource + # name without final answer. The API users need to do the polling to get + # the latest status of answer/session by calling + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} + # or + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} + # method. + # @param user_pseudo_id [::String] + # 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`. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] + # Optional. End user specification. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + # + # # Call the answer_query method. + # result = client.answer_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. + # p result + # + def answer_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.answer_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.answer_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.answer_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :answer_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Answer query method (streaming). + # + # It takes one + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} + # and returns multiple + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse AnswerQueryResponse} + # messages in a stream. + # + # @overload stream_answer_query(request, options = nil) + # Pass arguments to `stream_answer_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) + # Pass arguments to `stream_answer_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + # This field is used to identify the serving configuration name, set + # of models used to make the search. + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Required. Current user query. + # @param session [::String] + # The session resource name. Not required. + # + # When session field is not set, the API is in sessionless mode. + # + # We support auto session mode: users can use the wildcard symbol `-` as + # session ID. A new ID will be automatically generated and assigned. + # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] + # Model specification. + # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] + # Related questions specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] + # Optional. Grounding specification. + # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] + # Answer generation specification. + # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] + # Search specification. + # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] + # Query understanding specification. + # @param asynchronous_mode [::Boolean] + # Deprecated: This field is deprecated. Streaming Answer API will be + # supported. + # + # Asynchronous mode control. + # + # If enabled, the response will be returned with answer/session resource + # name without final answer. The API users need to do the polling to get + # the latest status of answer/session by calling + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} + # or + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} + # method. + # @param user_pseudo_id [::String] + # 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`. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] + # Optional. End user specification. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + # + # # Call the stream_answer_query method to start streaming. + # output = client.stream_answer_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_answer_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_answer_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stream_answer_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_answer_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :stream_answer_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Answer. + # + # @overload get_answer(request, options = nil) + # Pass arguments to `get_answer` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_answer(name: nil) + # Pass arguments to `get_answer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Answer to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Answer] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new + # + # # Call the get_answer method. + # result = client.get_answer request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. + # p result + # + def get_answer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_answer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_answer.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_answer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :get_answer, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session(parent: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The session to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :create_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :delete_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Session. + # + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The Session to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session&.name + header_params["session.name"] = request.session.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :update_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session(name: nil, include_answer_details: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @param include_answer_details [::Boolean] + # Optional. If set to true, the full session including all answer details + # will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :get_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Sessions by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSessions` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A comma-separated list of fields to filter by, in EBNF grammar. + # The supported fields are: + # * `user_pseudo_id` + # * `state` + # * `display_name` + # * `starred` + # * `is_pinned` + # * `labels` + # * `create_time` + # * `update_time` + # + # Examples: + # "user_pseudo_id = some_id" + # "display_name = \"some_name\"" + # "starred = true" + # "is_pinned=true AND (NOT labels:hidden)" + # "create_time > \"1970-01-01T12:00:00Z\"" + # @param order_by [::String] + # 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` + # * `session_name` + # * `is_pinned` + # + # Example: + # + # * "update_time desc" + # * "create_time" + # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then + # by update_time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ConversationalSearchService API. + # + # This class represents the configuration for ConversationalSearchService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # converse_conversation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.converse_conversation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.converse_conversation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ConversationalSearchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `converse_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :converse_conversation + ## + # RPC-specific configuration for `create_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation + ## + # RPC-specific configuration for `delete_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation + ## + # RPC-specific configuration for `update_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_conversation + ## + # RPC-specific configuration for `get_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation + ## + # RPC-specific configuration for `list_conversations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversations + ## + # RPC-specific configuration for `answer_query` + # @return [::Gapic::Config::Method] + # + attr_reader :answer_query + ## + # RPC-specific configuration for `stream_answer_query` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_answer_query + ## + # RPC-specific configuration for `get_answer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_answer + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + + # @private + def initialize parent_rpcs = nil + converse_conversation_config = parent_rpcs.converse_conversation if parent_rpcs.respond_to? :converse_conversation + @converse_conversation = ::Gapic::Config::Method.new converse_conversation_config + create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation + @create_conversation = ::Gapic::Config::Method.new create_conversation_config + delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation + @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config + update_conversation_config = parent_rpcs.update_conversation if parent_rpcs.respond_to? :update_conversation + @update_conversation = ::Gapic::Config::Method.new update_conversation_config + get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation + @get_conversation = ::Gapic::Config::Method.new get_conversation_config + list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations + @list_conversations = ::Gapic::Config::Method.new list_conversations_config + answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query + @answer_query = ::Gapic::Config::Method.new answer_query_config + stream_answer_query_config = parent_rpcs.stream_answer_query if parent_rpcs.respond_to? :stream_answer_query + @stream_answer_query = ::Gapic::Config::Method.new stream_answer_query_config + get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer + @get_answer = ::Gapic::Config::Method.new get_answer_config + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb new file mode 100644 index 000000000000..9221f872e79f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + # Credentials for the ConversationalSearchService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb new file mode 100644 index 000000000000..59378d548c66 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + # Path helper methods for the ConversationalSearchService API. + module Paths + ## + # Create a fully-qualified Answer resource string. + # + # @overload answer_path(project:, location:, data_store:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # @param answer [String] + # + # @overload answer_path(project:, location:, collection:, data_store:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # @param answer [String] + # + # @overload answer_path(project:, location:, collection:, engine:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # @param answer [String] + # + # @return [::String] + def answer_path **args + resources = { + "answer:data_store:location:project:session" => (proc do |project:, location:, data_store:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" + end), + "answer:collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" + end), + "answer:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/answers/#{answer}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified AssistAnswer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # @param assist_answer [String] + # + # @return [::String] + def assist_answer_path project:, location:, collection:, engine:, session:, assist_answer: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/assistAnswers/#{assist_answer}" + end + + ## + # Create a fully-qualified Chunk resource string. + # + # @overload chunk_path(project:, location:, data_store:, branch:, document:, chunk:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # @param chunk [String] + # + # @overload chunk_path(project:, location:, collection:, data_store:, branch:, document:, chunk:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # @param chunk [String] + # + # @return [::String] + def chunk_path **args + resources = { + "branch:chunk:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:, chunk:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" + end), + "branch:chunk:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:, chunk:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Conversation resource string. + # + # @overload conversation_path(project:, location:, data_store:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param conversation [String] + # + # @overload conversation_path(project:, location:, collection:, data_store:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param conversation [String] + # + # @overload conversation_path(project:, location:, collection:, engine:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param conversation [String] + # + # @return [::String] + def conversation_path **args + resources = { + "conversation:data_store:location:project" => (proc do |project:, location:, data_store:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/conversations/#{conversation}" + end), + "collection:conversation:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/conversations/#{conversation}" + end), + "collection:conversation:engine:location:project" => (proc do |project:, location:, collection:, engine:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/conversations/#{conversation}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified ServingConfig resource string. + # + # @overload serving_config_path(project:, location:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path **args + resources = { + "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, engine:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb new file mode 100644 index 000000000000..a93bd621ec05 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/conversational_search_service/credentials" +require "google/cloud/discovery_engine/v1/conversational_search_service/paths" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for conversational search. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/conversational_search_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + module ConversationalSearchService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb new file mode 100644 index 000000000000..7c7a56c7e99e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb @@ -0,0 +1,1887 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/conversational_search_service_pb" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + module Rest + ## + # REST client for the ConversationalSearchService service. + # + # Service for conversational search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversational_search_service_stub + + ## + # Configure the ConversationalSearchService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationalSearchService clients + # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationalSearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @conversational_search_service_stub.universe_domain + end + + ## + # Create a new ConversationalSearchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationalSearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @conversational_search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversational_search_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @conversational_search_service_stub.endpoint + config.universe_domain = @conversational_search_service_stub.universe_domain + config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @conversational_search_service_stub.logger + end + + # Service calls + + ## + # Converses a conversation. + # + # @overload converse_conversation(request, options = nil) + # Pass arguments to `converse_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) + # Pass arguments to `converse_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + # Use + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + # to activate auto session mode, which automatically creates a new + # conversation inside a ConverseConversation session. + # @param query [::Google::Cloud::DiscoveryEngine::V1::TextInput, ::Hash] + # Required. Current user input. + # @param serving_config [::String] + # The resource name of the Serving Config to use. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + # If this is not set, the default serving config will be used. + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # 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. + # @param safe_search [::Boolean] + # Whether to turn on safe search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param summary_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec, ::Hash] + # A specification for configuring the summary returned in the response. + # @param filter [::String] + # 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. This will be used to filter search results + # which may affect the summary response. + # + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents in search results which may + # affect the converse response. For more information on boosting, see + # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new + # + # # Call the converse_conversation method. + # result = client.converse_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. + # p result + # + def converse_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.converse_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.converse_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.converse_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.converse_conversation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Conversation. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to + # create already exists, an ALREADY_EXISTS error is returned. + # + # @overload create_conversation(request, options = nil) + # Pass arguments to `create_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_conversation(parent: nil, conversation: nil) + # Pass arguments to `create_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # Required. The conversation to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def create_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.create_conversation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Conversation. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to + # delete does not exist, a NOT_FOUND error is returned. + # + # @overload delete_conversation(request, options = nil) + # Pass arguments to `delete_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_conversation(name: nil) + # Pass arguments to `delete_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new + # + # # Call the delete_conversation method. + # result = client.delete_conversation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.delete_conversation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Conversation. + # + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} action type + # cannot be changed. If the + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update does + # not exist, a NOT_FOUND error is returned. + # + # @overload update_conversation(request, options = nil) + # Pass arguments to `update_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_conversation(conversation: nil, update_mask: nil) + # Pass arguments to `update_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] + # Required. The Conversation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new + # + # # Call the update_conversation method. + # result = client.update_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def update_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.update_conversation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Conversation. + # + # @overload get_conversation(request, options = nil) + # Pass arguments to `get_conversation` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_conversation(name: nil) + # Pass arguments to `get_conversation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # + def get_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_conversation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.get_conversation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Conversations by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_conversations(request, options = nil) + # Pass arguments to `list_conversations` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_conversations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListConversations` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A filter to apply on the list results. The supported features are: + # user_pseudo_id, state. + # + # Example: + # "user_pseudo_id = some_id" + # @param order_by [::String] + # 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" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new + # + # # Call the list_conversations method. + # result = client.list_conversations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. + # p item + # end + # + def list_conversations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_conversations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_conversations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_conversations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.list_conversations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, "conversations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Answer query method. + # + # @overload answer_query(request, options = nil) + # Pass arguments to `answer_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) + # Pass arguments to `answer_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + # This field is used to identify the serving configuration name, set + # of models used to make the search. + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Required. Current user query. + # @param session [::String] + # The session resource name. Not required. + # + # When session field is not set, the API is in sessionless mode. + # + # We support auto session mode: users can use the wildcard symbol `-` as + # session ID. A new ID will be automatically generated and assigned. + # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] + # Model specification. + # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] + # Related questions specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] + # Optional. Grounding specification. + # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] + # Answer generation specification. + # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] + # Search specification. + # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] + # Query understanding specification. + # @param asynchronous_mode [::Boolean] + # Deprecated: This field is deprecated. Streaming Answer API will be + # supported. + # + # Asynchronous mode control. + # + # If enabled, the response will be returned with answer/session resource + # name without final answer. The API users need to do the polling to get + # the latest status of answer/session by calling + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_answer ConversationalSearchService.GetAnswer} + # or + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_session ConversationalSearchService.GetSession} + # method. + # @param user_pseudo_id [::String] + # 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`. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] + # Optional. End user specification. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + # + # # Call the answer_query method. + # result = client.answer_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. + # p result + # + def answer_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.answer_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.answer_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.answer_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.answer_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Answer query method (streaming). + # + # It takes one + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} + # and returns multiple + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse AnswerQueryResponse} + # messages in a stream. + # + # @overload stream_answer_query(request, options = nil) + # Pass arguments to `stream_answer_query` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) + # Pass arguments to `stream_answer_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + # This field is used to identify the serving configuration name, set + # of models used to make the search. + # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] + # Required. Current user query. + # @param session [::String] + # The session resource name. Not required. + # + # When session field is not set, the API is in sessionless mode. + # + # We support auto session mode: users can use the wildcard symbol `-` as + # session ID. A new ID will be automatically generated and assigned. + # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] + # Model specification. + # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] + # Related questions specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] + # Optional. Grounding specification. + # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] + # Answer generation specification. + # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] + # Search specification. + # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] + # Query understanding specification. + # @param asynchronous_mode [::Boolean] + # Deprecated: This field is deprecated. Streaming Answer API will be + # supported. + # + # Asynchronous mode control. + # + # If enabled, the response will be returned with answer/session resource + # name without final answer. The API users need to do the polling to get + # the latest status of answer/session by calling + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_answer ConversationalSearchService.GetAnswer} + # or + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_session ConversationalSearchService.GetSession} + # method. + # @param user_pseudo_id [::String] + # 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`. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] + # Optional. End user specification. + # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + # + # # Call the stream_answer_query method to start streaming. + # output = client.stream_answer_query request + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_answer_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stream_answer_query.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_answer_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stream_answer_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + ::Gapic::Rest::ServerStream.new( + ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, + ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| + @conversational_search_service_stub.stream_answer_query request, options do |chunk| + in_q.deq + out_q.enq chunk + end + end + ) + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Answer. + # + # @overload get_answer(request, options = nil) + # Pass arguments to `get_answer` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_answer(name: nil) + # Pass arguments to `get_answer` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Answer to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new + # + # # Call the get_answer method. + # result = client.get_answer request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. + # p result + # + def get_answer request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_answer.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_answer.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_answer.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.get_answer request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_session(parent: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The session to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.create_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.delete_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Session. + # + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The Session to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.update_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_session(name: nil, include_answer_details: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @param include_answer_details [::Boolean] + # Optional. If set to true, the full session including all answer details + # will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.get_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Sessions by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSessions` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A comma-separated list of fields to filter by, in EBNF grammar. + # The supported fields are: + # * `user_pseudo_id` + # * `state` + # * `display_name` + # * `starred` + # * `is_pinned` + # * `labels` + # * `create_time` + # * `update_time` + # + # Examples: + # "user_pseudo_id = some_id" + # "display_name = \"some_name\"" + # "starred = true" + # "is_pinned=true AND (NOT labels:hidden)" + # "create_time > \"1970-01-01T12:00:00Z\"" + # @param order_by [::String] + # 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` + # * `session_name` + # * `is_pinned` + # + # Example: + # + # * "update_time desc" + # * "create_time" + # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then + # by update_time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversational_search_service_stub.list_sessions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ConversationalSearchService REST API. + # + # This class represents the configuration for ConversationalSearchService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # converse_conversation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.converse_conversation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.converse_conversation.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ConversationalSearchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `converse_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :converse_conversation + ## + # RPC-specific configuration for `create_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation + ## + # RPC-specific configuration for `delete_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation + ## + # RPC-specific configuration for `update_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_conversation + ## + # RPC-specific configuration for `get_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation + ## + # RPC-specific configuration for `list_conversations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversations + ## + # RPC-specific configuration for `answer_query` + # @return [::Gapic::Config::Method] + # + attr_reader :answer_query + ## + # RPC-specific configuration for `stream_answer_query` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_answer_query + ## + # RPC-specific configuration for `get_answer` + # @return [::Gapic::Config::Method] + # + attr_reader :get_answer + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + + # @private + def initialize parent_rpcs = nil + converse_conversation_config = parent_rpcs.converse_conversation if parent_rpcs.respond_to? :converse_conversation + @converse_conversation = ::Gapic::Config::Method.new converse_conversation_config + create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation + @create_conversation = ::Gapic::Config::Method.new create_conversation_config + delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation + @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config + update_conversation_config = parent_rpcs.update_conversation if parent_rpcs.respond_to? :update_conversation + @update_conversation = ::Gapic::Config::Method.new update_conversation_config + get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation + @get_conversation = ::Gapic::Config::Method.new get_conversation_config + list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations + @list_conversations = ::Gapic::Config::Method.new list_conversations_config + answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query + @answer_query = ::Gapic::Config::Method.new answer_query_config + stream_answer_query_config = parent_rpcs.stream_answer_query if parent_rpcs.respond_to? :stream_answer_query + @stream_answer_query = ::Gapic::Config::Method.new stream_answer_query_config + get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer + @get_answer = ::Gapic::Config::Method.new get_answer_config + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb new file mode 100644 index 000000000000..b32da44ebdd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb @@ -0,0 +1,1146 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/conversational_search_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + module Rest + ## + # REST service stub for the ConversationalSearchService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the converse_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] + # A result object deserialized from the server's reply + def converse_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_converse_conversation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "converse_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # A result object deserialized from the server's reply + def create_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # A result object deserialized from the server's reply + def update_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_conversation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # A result object deserialized from the server's reply + def get_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_conversations REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse] + # A result object deserialized from the server's reply + def list_conversations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_conversations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_conversations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the answer_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] + # A result object deserialized from the server's reply + def answer_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_answer_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "answer_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stream_answer_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yieldparam chunk [::String] The chunk of data received during server streaming. + # + # @return [::Gapic::Rest::TransportOperation] + def stream_answer_query(request_pb, options = nil, &) + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stream_answer_query_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "stream_answer_query", + options: options, + is_server_streaming: true, + & + ) + ::Gapic::Rest::TransportOperation.new response + end + + ## + # Baseline implementation for the get_answer REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] + # A result object deserialized from the server's reply + def get_answer request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_answer_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_answer", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Answer.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def create_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def update_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def get_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] + # A result object deserialized from the server's reply + def list_sessions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_sessions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the converse_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_converse_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:converse", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:converse", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:converse", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/conversations", + body: "conversation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/conversations", + body: "conversation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/conversations", + body: "conversation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{conversation.name}", + body: "conversation", + matches: [ + ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{conversation.name}", + body: "conversation", + matches: [ + ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{conversation.name}", + body: "conversation", + matches: [ + ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_conversations REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_conversations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/conversations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/conversations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/conversations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the answer_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_answer_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:answer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:answer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:answer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stream_answer_query REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stream_answer_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:streamAnswer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:streamAnswer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:streamAnswer", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_answer REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_answer_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_sessions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb new file mode 100644 index 000000000000..fd1ee755d3f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/data_store_service/credentials" +require "google/cloud/discovery_engine/v1/data_store_service/paths" +require "google/cloud/discovery_engine/v1/data_store_service/operations" +require "google/cloud/discovery_engine/v1/data_store_service/client" +require "google/cloud/discovery_engine/v1/data_store_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # configuration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/data_store_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/data_store_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + module DataStoreService + end + end + end + end +end + +helper_path = ::File.join __dir__, "data_store_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/data_store_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb new file mode 100644 index 000000000000..0c812d7e86ae --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb @@ -0,0 +1,1000 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/data_store_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + ## + # Client for the DataStoreService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :data_store_service_stub + + ## + # Configure the DataStoreService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DataStoreService clients + # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DataStoreService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @data_store_service_stub.universe_domain + end + + ## + # Create a new DataStoreService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DataStoreService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/data_store_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @data_store_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @data_store_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_store_service_stub.endpoint + config.universe_domain = @data_store_service_stub.universe_domain + config.logger = @data_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @data_store_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # DataStore is for storing + # {::Google::Cloud::DiscoveryEngine::V1::Document Documents}. To serve these + # documents for Search, or Recommendation use case, an + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} needs to be created + # separately. + # + # @overload create_data_store(request, options = nil) + # Pass arguments to `create_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_data_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) + # Pass arguments to `create_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cmek_config_name [::String] + # Resource name of the CmekConfig to use for protecting this DataStore. + # + # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disable_cmek [::Boolean] + # DataStore without CMEK protections. If a default CmekConfig is set for + # the project, setting this field will override the default CmekConfig as + # well. + # + # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # create. + # @param data_store_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become + # the final component of the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. + # + # 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. + # @param create_advanced_site_search [::Boolean] + # A boolean flag indicating whether user want to directly create an advanced + # data store for site search. + # If the data store is not configured as site + # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will + # be ignored. + # @param skip_default_schema_creation [::Boolean] + # A boolean flag indicating whether to skip the default schema creation for + # the data store. Only enable this flag if you are certain that the default + # schema is incompatible with your use case. + # + # If set to true, you must manually create a schema for the data store before + # any documents can be ingested. + # + # This flag cannot be specified if `data_store.starting_schema` is specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new + # + # # Call the create_data_store method. + # result = client.create_data_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_data_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.call_rpc :create_data_store, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload get_data_store(request, options = nil) + # Pass arguments to `get_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_data_store(name: nil) + # Pass arguments to `get_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # does not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new + # + # # Call the get_data_store method. + # result = client.get_data_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + # p result + # + def get_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_data_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.call_rpc :get_data_store, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s + # associated with the project. + # + # @overload list_data_stores(request, options = nil) + # Pass arguments to `list_data_stores` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_data_stores` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this + # location, regardless of whether or not this data store exists, a + # PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s + # to return. If unspecified, defaults to 10. The maximum allowed value is 50. + # Values above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param filter [::String] + # Filter by solution type . + # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new + # + # # Call the list_data_stores method. + # result = client.list_data_stores request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. + # p item + # end + # + def list_data_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_data_stores.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.call_rpc :list_data_stores, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @data_store_service_stub, :list_data_stores, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload delete_data_store(request, options = nil) + # Pass arguments to `delete_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_data_store(name: nil) + # Pass arguments to `delete_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete + # does not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new + # + # # Call the delete_data_store method. + # result = client.delete_data_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.call_rpc :delete_data_store, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # + # @overload update_data_store(request, options = nil) + # Pass arguments to `update_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_data_store(data_store: nil, update_mask: nil) + # Pass arguments to `update_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update + # does not exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new + # + # # Call the update_data_store method. + # result = client.update_data_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + # p result + # + def update_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.data_store&.name + header_params["data_store.name"] = request.data_store.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_data_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.call_rpc :update_data_store, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DataStoreService API. + # + # This class represents the configuration for DataStoreService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_data_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_data_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_data_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DataStoreService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_store + ## + # RPC-specific configuration for `get_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_store + ## + # RPC-specific configuration for `list_data_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_stores + ## + # RPC-specific configuration for `delete_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_store + ## + # RPC-specific configuration for `update_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_store + + # @private + def initialize parent_rpcs = nil + create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store + @create_data_store = ::Gapic::Config::Method.new create_data_store_config + get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store + @get_data_store = ::Gapic::Config::Method.new get_data_store_config + list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores + @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config + delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store + @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config + update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store + @update_data_store = ::Gapic::Config::Method.new update_data_store_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb new file mode 100644 index 000000000000..efcc9e826944 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + # Credentials for the DataStoreService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb new file mode 100644 index 000000000000..837ad6879784 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DataStoreService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DataStoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb new file mode 100644 index 000000000000..3a4abf733e7c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb @@ -0,0 +1,295 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + # Path helper methods for the DataStoreService API. + module Paths + ## + # Create a fully-qualified CmekConfig resource string. + # + # @overload cmek_config_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfig` + # + # @param project [String] + # @param location [String] + # + # @overload cmek_config_path(project:, location:, cmek_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` + # + # @param project [String] + # @param location [String] + # @param cmek_config [String] + # + # @return [::String] + def cmek_config_path **args + resources = { + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfig" + end), + "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Collection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # + # @return [::String] + def collection_path project:, location:, collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}" + end + + ## + # Create a fully-qualified CryptoKeyVersions resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified CryptoKeys resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_keys_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified DocumentProcessingConfig resource string. + # + # @overload document_processing_config_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload document_processing_config_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def document_processing_config_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/documentProcessingConfig" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/documentProcessingConfig" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified IdentityMappingStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}` + # + # @param project [String] + # @param location [String] + # @param identity_mapping_store [String] + # + # @return [::String] + def identity_mapping_store_path project:, location:, identity_mapping_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/identityMappingStores/#{identity_mapping_store}" + end + + ## + # Create a fully-qualified Schema resource string. + # + # @overload schema_path(project:, location:, data_store:, schema:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param schema [String] + # + # @overload schema_path(project:, location:, collection:, data_store:, schema:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param schema [String] + # + # @return [::String] + def schema_path **args + resources = { + "data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/schemas/#{schema}" + end), + "collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/schemas/#{schema}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb new file mode 100644 index 000000000000..bdbe57c88f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/data_store_service/credentials" +require "google/cloud/discovery_engine/v1/data_store_service/paths" +require "google/cloud/discovery_engine/v1/data_store_service/rest/operations" +require "google/cloud/discovery_engine/v1/data_store_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # configuration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/data_store_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + module DataStoreService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/data_store_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb new file mode 100644 index 000000000000..d460e14bc845 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb @@ -0,0 +1,922 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/data_store_service_pb" +require "google/cloud/discovery_engine/v1/data_store_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + module Rest + ## + # REST client for the DataStoreService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :data_store_service_stub + + ## + # Configure the DataStoreService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DataStoreService clients + # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DataStoreService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @data_store_service_stub.universe_domain + end + + ## + # Create a new DataStoreService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DataStoreService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @data_store_service_stub = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @data_store_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @data_store_service_stub.endpoint + config.universe_domain = @data_store_service_stub.universe_domain + config.logger = @data_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @data_store_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # DataStore is for storing + # {::Google::Cloud::DiscoveryEngine::V1::Document Documents}. To serve these + # documents for Search, or Recommendation use case, an + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} needs to be created + # separately. + # + # @overload create_data_store(request, options = nil) + # Pass arguments to `create_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_data_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) + # Pass arguments to `create_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cmek_config_name [::String] + # Resource name of the CmekConfig to use for protecting this DataStore. + # + # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disable_cmek [::Boolean] + # DataStore without CMEK protections. If a default CmekConfig is set for + # the project, setting this field will override the default CmekConfig as + # well. + # + # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # create. + # @param data_store_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become + # the final component of the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. + # + # 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. + # @param create_advanced_site_search [::Boolean] + # A boolean flag indicating whether user want to directly create an advanced + # data store for site search. + # If the data store is not configured as site + # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will + # be ignored. + # @param skip_default_schema_creation [::Boolean] + # A boolean flag indicating whether to skip the default schema creation for + # the data store. Only enable this flag if you are certain that the default + # schema is incompatible with your use case. + # + # If set to true, you must manually create a schema for the data store before + # any documents can be ingested. + # + # This flag cannot be specified if `data_store.starting_schema` is specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new + # + # # Call the create_data_store method. + # result = client.create_data_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_data_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.create_data_store request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload get_data_store(request, options = nil) + # Pass arguments to `get_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_data_store(name: nil) + # Pass arguments to `get_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # does not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new + # + # # Call the get_data_store method. + # result = client.get_data_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + # p result + # + def get_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_data_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.get_data_store request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s + # associated with the project. + # + # @overload list_data_stores(request, options = nil) + # Pass arguments to `list_data_stores` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_data_stores` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this + # location, regardless of whether or not this data store exists, a + # PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s + # to return. If unspecified, defaults to 10. The maximum allowed value is 50. + # Values above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client#list_data_stores DataStoreService.ListDataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client#list_data_stores DataStoreService.ListDataStores} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @param filter [::String] + # Filter by solution type . + # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new + # + # # Call the list_data_stores method. + # result = client.list_data_stores request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. + # p item + # end + # + def list_data_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_data_stores.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.list_data_stores request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @data_store_service_stub, :list_data_stores, "data_stores", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload delete_data_store(request, options = nil) + # Pass arguments to `delete_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_data_store(name: nil) + # Pass arguments to `delete_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete + # does not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new + # + # # Call the delete_data_store method. + # result = client.delete_data_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.delete_data_store request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # + # @overload update_data_store(request, options = nil) + # Pass arguments to `update_data_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_data_store(data_store: nil, update_mask: nil) + # Pass arguments to `update_data_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update + # does not exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new + # + # # Call the update_data_store method. + # result = client.update_data_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + # p result + # + def update_data_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_data_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_data_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_data_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @data_store_service_stub.update_data_store request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DataStoreService REST API. + # + # This class represents the configuration for DataStoreService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_data_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_data_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_data_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DataStoreService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_store + ## + # RPC-specific configuration for `get_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_store + ## + # RPC-specific configuration for `list_data_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_stores + ## + # RPC-specific configuration for `delete_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_store + ## + # RPC-specific configuration for `update_data_store` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_store + + # @private + def initialize parent_rpcs = nil + create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store + @create_data_store = ::Gapic::Config::Method.new create_data_store_config + get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store + @get_data_store = ::Gapic::Config::Method.new get_data_store_config + list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores + @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config + delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store + @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config + update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store + @update_data_store = ::Gapic::Config::Method.new update_data_store_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb new file mode 100644 index 000000000000..f66faa75a690 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DataStoreService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DataStoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb new file mode 100644 index 000000000000..8563e28526bc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb @@ -0,0 +1,425 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/data_store_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DataStoreService + module Rest + ## + # REST service stub for the DataStoreService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_data_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_data_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_data_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # A result object deserialized from the server's reply + def get_data_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_data_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_data_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_data_stores REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse] + # A result object deserialized from the server's reply + def list_data_stores request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_stores_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_data_stores", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_data_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_data_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # A result object deserialized from the server's reply + def update_data_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_data_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_data_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_data_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dataStores", + body: "data_store", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dataStores", + body: "data_store", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_data_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_stores REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_data_stores_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dataStores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dataStores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_data_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_data_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_data_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{data_store.name}", + body: "data_store", + matches: [ + ["data_store.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{data_store.name}", + body: "data_store", + matches: [ + ["data_store.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb new file mode 100644 index 000000000000..0d6246e410ff --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/document_service/credentials" +require "google/cloud/discovery_engine/v1/document_service/paths" +require "google/cloud/discovery_engine/v1/document_service/operations" +require "google/cloud/discovery_engine/v1/document_service/client" +require "google/cloud/discovery_engine/v1/document_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} + # information of the customer's website. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/document_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/document_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + module DocumentService + end + end + end + end +end + +helper_path = ::File.join __dir__, "document_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/document_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb new file mode 100644 index 000000000000..424824cff98f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb @@ -0,0 +1,1426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/document_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + ## + # Client for the DocumentService service. + # + # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} + # information of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :document_service_stub + + ## + # Configure the DocumentService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentService clients + # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_documents.timeout = 300.0 + default_config.rpcs.import_documents.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @document_service_stub.universe_domain + end + + ## + # Create a new DocumentService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/document_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @document_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @document_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + config.logger = @document_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @document_service_stub.logger + end + + # Service calls + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_document(name: nil) + # Pass arguments to `get_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does + # not exist, a `NOT_FOUND` error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :get_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_documents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, + # regardless of whether or not this branch exists, a `PERMISSION_DENIED` + # error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. If unspecified, defaults to 100. The maximum allowed value is 1000. + # Values above 1000 are set to 1000. + # + # If this field is negative, an `INVALID_ARGUMENT` error is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. + # p item + # end + # + def list_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :list_documents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_service_stub, :list_documents, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_document(parent: nil, document: nil, document_id: nil) + # Pass arguments to `create_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to + # create. + # @param document_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the + # final component of the + # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # This field must be unique among all + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same + # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def create_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :create_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_document(document: nil, allow_missing: nil, update_mask: nil) + # Pass arguments to `update_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] + # Required. The document to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does + # not exist and + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} + # is not set, a `NOT_FOUND` error is returned. + # @param allow_missing [::Boolean] + # If set to `true` and the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported 'document' to update. If + # not set, by default updates all fields. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def update_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.document&.name + header_params["document.name"] = request.document.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :update_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_document(name: nil) + # Pass arguments to `delete_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does + # not exist, a `NOT_FOUND` error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :delete_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Bulk import of multiple + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Request processing + # may be synchronous. Non-existing items are created. + # + # Note: It is possible for a subset of the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be successfully + # updated. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) + # Pass arguments to `import_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource, ::Hash] + # The Inline source for the input content for documents. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param fhir_store_source [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource, ::Hash] + # FhirStore input source. + # + # Note: The following parameters are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param spanner_source [::Google::Cloud::DiscoveryEngine::V1::SpannerSource, ::Hash] + # Spanner input source. + # + # Note: The following parameters are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param cloud_sql_source [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource, ::Hash] + # Cloud SQL input source. + # + # Note: The following parameters are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource, ::Hash] + # Firestore input source. + # + # Note: The following parameters are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource, ::Hash] + # AlloyDB input source. + # + # Note: The following parameters are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1::BigtableSource, ::Hash] + # Cloud Bigtable input source. + # + # Note: The following parameters are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # Requires create/update permission. + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. + # @param reconciliation_mode [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] + # The mode of reconciliation between existing documents and the documents to + # be imported. Defaults to + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported documents to update. If + # not set, the default is to update all fields. + # @param auto_generate_ids [::Boolean] + # Whether to automatically generate IDs for the documents if absent. + # + # If set to `true`, + # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} + # is highly recommended to avoid duplicate contents. If unset or set to + # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have + # to be specified using + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, + # otherwise, documents without IDs fail to be imported. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @param id_field [::String] + # The field indicates the ID field or column to be used as unique IDs of + # the documents. + # + # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of + # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + # For others, it may be the column name of the table where the unique ids are + # stored. + # + # The values of the JSON field or the table column are used as the + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field + # or the table 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @param force_refresh_content [::Boolean] + # Optional. Whether to force refresh the unstructured content of the + # documents. + # + # If set to `true`, the content part of the documents will be refreshed + # regardless of the update status of the referencing content. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :import_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all selected + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s in a branch. + # + # This process is asynchronous. Depending on the number of + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be deleted, this + # operation can take hours to complete. Before the delete operation + # completes, some {::Google::Cloud::DiscoveryEngine::V1::Document Document}s might + # still be returned by + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} + # or + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments}. + # + # To get a list of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s + # to be deleted, set + # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest#force PurgeDocumentsRequest.force} + # to false. + # + # @overload purge_documents(request, options = nil) + # Pass arguments to `purge_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) + # Pass arguments to `purge_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # Supported `data_schema`: + # * `document_id`: One valid + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource, ::Hash] + # Inline source for the input content for purge. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param filter [::String] + # Required. Filter matching documents to purge. Only currently supported + # value is + # `*` (all items). + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig, ::Hash] + # The desired location of errors incurred during the purge. + # @param force [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any documents. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new + # + # # Call the purge_documents method. + # result = client.purge_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.purge_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.purge_documents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :purge_documents, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets index freshness metadata for + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Supported for + # website search only. + # + # @overload batch_get_documents_metadata(request, options = nil) + # Pass arguments to `batch_get_documents_metadata` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_get_documents_metadata(parent: nil, matcher: nil) + # Pass arguments to `batch_get_documents_metadata` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param matcher [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher, ::Hash] + # Required. Matcher for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new + # + # # Call the batch_get_documents_metadata method. + # result = client.batch_get_documents_metadata request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. + # p result + # + def batch_get_documents_metadata request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_get_documents_metadata.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_get_documents_metadata.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_get_documents_metadata.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.call_rpc :batch_get_documents_metadata, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentService API. + # + # This class represents the configuration for DocumentService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the DocumentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `purge_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_documents + ## + # RPC-specific configuration for `batch_get_documents_metadata` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_documents_metadata + + # @private + def initialize parent_rpcs = nil + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_document_config + update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document + @update_document = ::Gapic::Config::Method.new update_document_config + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_document_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + purge_documents_config = parent_rpcs.purge_documents if parent_rpcs.respond_to? :purge_documents + @purge_documents = ::Gapic::Config::Method.new purge_documents_config + batch_get_documents_metadata_config = parent_rpcs.batch_get_documents_metadata if parent_rpcs.respond_to? :batch_get_documents_metadata + @batch_get_documents_metadata = ::Gapic::Config::Method.new batch_get_documents_metadata_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb new file mode 100644 index 000000000000..68be7028f336 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + # Credentials for the DocumentService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb new file mode 100644 index 000000000000..599b9ead6f54 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb new file mode 100644 index 000000000000..56ab199c40b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + # Path helper methods for the DocumentService API. + module Paths + ## + # Create a fully-qualified Branch resource string. + # + # @overload branch_path(project:, location:, data_store:, branch:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # + # @overload branch_path(project:, location:, collection:, data_store:, branch:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # + # @return [::String] + def branch_path **args + resources = { + "branch:data_store:location:project" => (proc do |project:, location:, data_store:, branch:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}" + end), + "branch:collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, branch:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified FhirResource resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param fhir_store [String] + # @param resource_type [String] + # @param fhir_resource_id [String] + # + # @return [::String] + def fhir_resource_path project:, location:, dataset:, fhir_store:, resource_type:, fhir_resource_id: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + raise ::ArgumentError, "fhir_store cannot contain /" if fhir_store.to_s.include? "/" + raise ::ArgumentError, "resource_type cannot contain /" if resource_type.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/fhirStores/#{fhir_store}/fhir/#{resource_type}/#{fhir_resource_id}" + end + + ## + # Create a fully-qualified FhirStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param fhir_store [String] + # + # @return [::String] + def fhir_store_path project:, location:, dataset:, fhir_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}/fhirStores/#{fhir_store}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb new file mode 100644 index 000000000000..1bdbcdae81fa --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/document_service/credentials" +require "google/cloud/discovery_engine/v1/document_service/paths" +require "google/cloud/discovery_engine/v1/document_service/rest/operations" +require "google/cloud/discovery_engine/v1/document_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} + # information of the customer's website. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/document_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + module DocumentService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/document_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb new file mode 100644 index 000000000000..256d536216f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb @@ -0,0 +1,1327 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/document_service_pb" +require "google/cloud/discovery_engine/v1/document_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + module Rest + ## + # REST client for the DocumentService service. + # + # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} + # information of the customer's website. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :document_service_stub + + ## + # Configure the DocumentService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all DocumentService clients + # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_documents.timeout = 300.0 + default_config.rpcs.import_documents.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @document_service_stub.universe_domain + end + + ## + # Create a new DocumentService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the DocumentService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @document_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @document_service_stub.endpoint + config.universe_domain = @document_service_stub.universe_domain + config.logger = @document_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @document_service_stub.logger + end + + # Service calls + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_document(name: nil) + # Pass arguments to `get_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does + # not exist, a `NOT_FOUND` error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def get_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.get_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_documents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, + # regardless of whether or not this branch exists, a `PERMISSION_DENIED` + # error is returned. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. If unspecified, defaults to 100. The maximum allowed value is 1000. + # Values above 1000 are set to 1000. + # + # If this field is negative, an `INVALID_ARGUMENT` error is returned. + # @param page_token [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. + # p item + # end + # + def list_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.list_documents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @document_service_stub, :list_documents, "documents", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_document(parent: nil, document: nil, document_id: nil) + # Pass arguments to `create_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to + # create. + # @param document_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the + # final component of the + # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # This field must be unique among all + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same + # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def create_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.create_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_document(document: nil, allow_missing: nil, update_mask: nil) + # Pass arguments to `update_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] + # Required. The document to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does + # not exist and + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} + # is not set, a `NOT_FOUND` error is returned. + # @param allow_missing [::Boolean] + # If set to `true` and the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported 'document' to update. If + # not set, by default updates all fields. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # + def update_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.update_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_document(name: nil) + # Pass arguments to `delete_document` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does + # not exist, a `NOT_FOUND` error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_document.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.delete_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Bulk import of multiple + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Request processing + # may be synchronous. Non-existing items are created. + # + # Note: It is possible for a subset of the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be successfully + # updated. + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) + # Pass arguments to `import_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource, ::Hash] + # The Inline source for the input content for documents. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param fhir_store_source [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource, ::Hash] + # FhirStore input source. + # + # Note: The following parameters are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param spanner_source [::Google::Cloud::DiscoveryEngine::V1::SpannerSource, ::Hash] + # Spanner input source. + # + # Note: The following parameters are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param cloud_sql_source [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource, ::Hash] + # Cloud SQL input source. + # + # Note: The following parameters are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource, ::Hash] + # Firestore input source. + # + # Note: The following parameters are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource, ::Hash] + # AlloyDB input source. + # + # Note: The following parameters are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1::BigtableSource, ::Hash] + # Cloud Bigtable input source. + # + # Note: The following parameters are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # Requires create/update permission. + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. + # @param reconciliation_mode [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] + # The mode of reconciliation between existing documents and the documents to + # be imported. Defaults to + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided imported documents to update. If + # not set, the default is to update all fields. + # @param auto_generate_ids [::Boolean] + # Whether to automatically generate IDs for the documents if absent. + # + # If set to `true`, + # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} + # is highly recommended to avoid duplicate contents. If unset or set to + # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have + # to be specified using + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, + # otherwise, documents without IDs fail to be imported. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @param id_field [::String] + # The field indicates the ID field or column to be used as unique IDs of + # the documents. + # + # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of + # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + # For others, it may be the column name of the table where the unique ids are + # stored. + # + # The values of the JSON field or the table column are used as the + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field + # or the table 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @param force_refresh_content [::Boolean] + # Optional. Whether to force refresh the unstructured content of the + # documents. + # + # If set to `true`, the content part of the documents will be refreshed + # regardless of the update status of the referencing content. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.import_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes all selected + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s in a branch. + # + # This process is asynchronous. Depending on the number of + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be deleted, this + # operation can take hours to complete. Before the delete operation + # completes, some {::Google::Cloud::DiscoveryEngine::V1::Document Document}s might + # still be returned by + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#get_document DocumentService.GetDocument} + # or + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments}. + # + # To get a list of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s + # to be deleted, set + # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest#force PurgeDocumentsRequest.force} + # to false. + # + # @overload purge_documents(request, options = nil) + # Pass arguments to `purge_documents` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) + # Pass arguments to `purge_documents` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # Supported `data_schema`: + # * `document_id`: One valid + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource, ::Hash] + # Inline source for the input content for purge. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param filter [::String] + # Required. Filter matching documents to purge. Only currently supported + # value is + # `*` (all items). + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig, ::Hash] + # The desired location of errors incurred during the purge. + # @param force [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any documents. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new + # + # # Call the purge_documents method. + # result = client.purge_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_documents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.purge_documents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_documents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_documents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.purge_documents request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets index freshness metadata for + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Supported for + # website search only. + # + # @overload batch_get_documents_metadata(request, options = nil) + # Pass arguments to `batch_get_documents_metadata` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_get_documents_metadata(parent: nil, matcher: nil) + # Pass arguments to `batch_get_documents_metadata` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @param matcher [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher, ::Hash] + # Required. Matcher for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new + # + # # Call the batch_get_documents_metadata method. + # result = client.batch_get_documents_metadata request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. + # p result + # + def batch_get_documents_metadata request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_get_documents_metadata.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_get_documents_metadata.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_get_documents_metadata.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_service_stub.batch_get_documents_metadata request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the DocumentService REST API. + # + # This class represents the configuration for DocumentService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_document to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_document.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the DocumentService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `purge_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_documents + ## + # RPC-specific configuration for `batch_get_documents_metadata` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_get_documents_metadata + + # @private + def initialize parent_rpcs = nil + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_document_config + update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document + @update_document = ::Gapic::Config::Method.new update_document_config + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_document_config + import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents + @import_documents = ::Gapic::Config::Method.new import_documents_config + purge_documents_config = parent_rpcs.purge_documents if parent_rpcs.respond_to? :purge_documents + @purge_documents = ::Gapic::Config::Method.new purge_documents_config + batch_get_documents_metadata_config = parent_rpcs.batch_get_documents_metadata if parent_rpcs.respond_to? :batch_get_documents_metadata + @batch_get_documents_metadata = ::Gapic::Config::Method.new batch_get_documents_metadata_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb new file mode 100644 index 000000000000..156d919282c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the DocumentService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the DocumentService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb new file mode 100644 index 000000000000..0a8a222d6448 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb @@ -0,0 +1,633 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/document_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + module Rest + ## + # REST service stub for the DocumentService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # A result object deserialized from the server's reply + def get_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse] + # A result object deserialized from the server's reply + def list_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_documents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # A result object deserialized from the server's reply + def create_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # A result object deserialized from the server's reply + def update_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_document_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_documents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def purge_documents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_documents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "purge_documents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_get_documents_metadata REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] + # A result object deserialized from the server's reply + def batch_get_documents_metadata request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_documents_metadata_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_get_documents_metadata", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/documents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/documents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_document REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_documents REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_documents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/documents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_get_documents_metadata REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_get_documents_metadata_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/batchGetDocumentsMetadata", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/batchGetDocumentsMetadata", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb new file mode 100644 index 000000000000..f57da3bbc668 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/engine_service/credentials" +require "google/cloud/discovery_engine/v1/engine_service/paths" +require "google/cloud/discovery_engine/v1/engine_service/operations" +require "google/cloud/discovery_engine/v1/engine_service/client" +require "google/cloud/discovery_engine/v1/engine_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # configuration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/engine_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/engine_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + module EngineService + end + end + end + end +end + +helper_path = ::File.join __dir__, "engine_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/engine_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb new file mode 100644 index 000000000000..dac37a116c03 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb @@ -0,0 +1,942 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/engine_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + ## + # Client for the EngineService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :engine_service_stub + + ## + # Configure the EngineService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EngineService clients + # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @engine_service_stub.universe_domain + end + + ## + # Create a new EngineService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/engine_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @engine_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @engine_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @engine_service_stub.endpoint + config.universe_domain = @engine_service_stub.universe_domain + config.logger = @engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @engine_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload create_engine(request, options = nil) + # Pass arguments to `create_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_engine(parent: nil, engine: nil, engine_id: nil) + # Pass arguments to `create_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. + # @param engine_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the + # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s + # resource name. + # + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new + # + # # Call the create_engine method. + # result = client.create_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.call_rpc :create_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload delete_engine(request, options = nil) + # Pass arguments to `delete_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_engine(name: nil) + # Pass arguments to `delete_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not + # exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new + # + # # Call the delete_engine method. + # result = client.delete_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.call_rpc :delete_engine, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # + # @overload update_engine(request, options = nil) + # Pass arguments to `update_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_engine(engine: nil, update_mask: nil) + # Pass arguments to `update_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not + # exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new + # + # # Call the update_engine method. + # result = client.update_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + # p result + # + def update_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.engine&.name + header_params["engine.name"] = request.engine.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.call_rpc :update_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload get_engine(request, options = nil) + # Pass arguments to `get_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_engine(name: nil) + # Pass arguments to `get_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new + # + # # Call the get_engine method. + # result = client.get_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + # p result + # + def get_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.call_rpc :get_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s associated + # with the project. + # + # @overload list_engines(request, options = nil) + # Pass arguments to `list_engines` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # @param page_size [::Integer] + # Optional. Not supported. + # @param page_token [::String] + # Optional. Not supported. + # @param filter [::String] + # Optional. Filter by solution type. For example: + # solution_type=SOLUTION_TYPE_SEARCH + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new + # + # # Call the list_engines method. + # result = client.list_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. + # p item + # end + # + def list_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_engines.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.call_rpc :list_engines, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @engine_service_stub, :list_engines, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EngineService API. + # + # This class represents the configuration for EngineService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the EngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_engine + ## + # RPC-specific configuration for `delete_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_engine + ## + # RPC-specific configuration for `update_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_engine + ## + # RPC-specific configuration for `get_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_engine + ## + # RPC-specific configuration for `list_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_engines + + # @private + def initialize parent_rpcs = nil + create_engine_config = parent_rpcs.create_engine if parent_rpcs.respond_to? :create_engine + @create_engine = ::Gapic::Config::Method.new create_engine_config + delete_engine_config = parent_rpcs.delete_engine if parent_rpcs.respond_to? :delete_engine + @delete_engine = ::Gapic::Config::Method.new delete_engine_config + update_engine_config = parent_rpcs.update_engine if parent_rpcs.respond_to? :update_engine + @update_engine = ::Gapic::Config::Method.new update_engine_config + get_engine_config = parent_rpcs.get_engine if parent_rpcs.respond_to? :get_engine + @get_engine = ::Gapic::Config::Method.new get_engine_config + list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines + @list_engines = ::Gapic::Config::Method.new list_engines_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb new file mode 100644 index 000000000000..409d5568acf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + # Credentials for the EngineService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb new file mode 100644 index 000000000000..5b667323c6b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the EngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb new file mode 100644 index 000000000000..dbad2dd5b2d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + # Path helper methods for the EngineService API. + module Paths + ## + # Create a fully-qualified Collection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # + # @return [::String] + def collection_path project:, location:, collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}" + end + + ## + # Create a fully-qualified Engine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # + # @return [::String] + def engine_path project:, location:, collection:, engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb new file mode 100644 index 000000000000..207c2f84013f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/engine_service/credentials" +require "google/cloud/discovery_engine/v1/engine_service/paths" +require "google/cloud/discovery_engine/v1/engine_service/rest/operations" +require "google/cloud/discovery_engine/v1/engine_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # configuration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/engine_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + module EngineService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/engine_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb new file mode 100644 index 000000000000..08ac6e4d954b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb @@ -0,0 +1,864 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/engine_service_pb" +require "google/cloud/discovery_engine/v1/engine_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + module Rest + ## + # REST client for the EngineService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # configuration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :engine_service_stub + + ## + # Configure the EngineService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EngineService clients + # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @engine_service_stub.universe_domain + end + + ## + # Create a new EngineService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @engine_service_stub = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @engine_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @engine_service_stub.endpoint + config.universe_domain = @engine_service_stub.universe_domain + config.logger = @engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @engine_service_stub.logger + end + + # Service calls + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload create_engine(request, options = nil) + # Pass arguments to `create_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_engine(parent: nil, engine: nil, engine_id: nil) + # Pass arguments to `create_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. + # @param engine_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the + # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s + # resource name. + # + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new + # + # # Call the create_engine method. + # result = client.create_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.create_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload delete_engine(request, options = nil) + # Pass arguments to `delete_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_engine(name: nil) + # Pass arguments to `delete_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not + # exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new + # + # # Call the delete_engine method. + # result = client.delete_engine request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.delete_engine request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} + # + # @overload update_engine(request, options = nil) + # Pass arguments to `update_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_engine(engine: nil, update_mask: nil) + # Pass arguments to `update_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not + # exist, a NOT_FOUND error is returned. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new + # + # # Call the update_engine method. + # result = client.update_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + # p result + # + def update_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.update_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # + # @overload get_engine(request, options = nil) + # Pass arguments to `get_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_engine(name: nil) + # Pass arguments to `get_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new + # + # # Call the get_engine method. + # result = client.get_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + # p result + # + def get_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.get_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s associated + # with the project. + # + # @overload list_engines(request, options = nil) + # Pass arguments to `list_engines` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_engines` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # @param page_size [::Integer] + # Optional. Not supported. + # @param page_token [::String] + # Optional. Not supported. + # @param filter [::String] + # Optional. Filter by solution type. For example: + # solution_type=SOLUTION_TYPE_SEARCH + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new + # + # # Call the list_engines method. + # result = client.list_engines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. + # p item + # end + # + def list_engines request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_engines.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_engines.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_engines.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @engine_service_stub.list_engines request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @engine_service_stub, :list_engines, "engines", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EngineService REST API. + # + # This class represents the configuration for EngineService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the EngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :create_engine + ## + # RPC-specific configuration for `delete_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_engine + ## + # RPC-specific configuration for `update_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :update_engine + ## + # RPC-specific configuration for `get_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_engine + ## + # RPC-specific configuration for `list_engines` + # @return [::Gapic::Config::Method] + # + attr_reader :list_engines + + # @private + def initialize parent_rpcs = nil + create_engine_config = parent_rpcs.create_engine if parent_rpcs.respond_to? :create_engine + @create_engine = ::Gapic::Config::Method.new create_engine_config + delete_engine_config = parent_rpcs.delete_engine if parent_rpcs.respond_to? :delete_engine + @delete_engine = ::Gapic::Config::Method.new delete_engine_config + update_engine_config = parent_rpcs.update_engine if parent_rpcs.respond_to? :update_engine + @update_engine = ::Gapic::Config::Method.new update_engine_config + get_engine_config = parent_rpcs.get_engine if parent_rpcs.respond_to? :get_engine + @get_engine = ::Gapic::Config::Method.new get_engine_config + list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines + @list_engines = ::Gapic::Config::Method.new list_engines_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb new file mode 100644 index 000000000000..71f04a56fcb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the EngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb new file mode 100644 index 000000000000..6f8d0ae88050 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/engine_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + module Rest + ## + # REST service stub for the EngineService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # A result object deserialized from the server's reply + def update_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Engine.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # A result object deserialized from the server's reply + def get_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Engine.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_engines REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse] + # A result object deserialized from the server's reply + def list_engines request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_engines_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_engines", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/engines", + body: "engine", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{engine.name}", + body: "engine", + matches: [ + ["engine.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_engines REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_engines_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/engines", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb new file mode 100644 index 000000000000..e39e8142d53e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/grounded_generation_service/credentials" +require "google/cloud/discovery_engine/v1/grounded_generation_service/paths" +require "google/cloud/discovery_engine/v1/grounded_generation_service/client" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for grounded generation. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/grounded_generation_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new + # + module GroundedGenerationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "grounded_generation_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/grounded_generation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb new file mode 100644 index 000000000000..a221ab67901c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb @@ -0,0 +1,733 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + ## + # Client for the GroundedGenerationService service. + # + # Service for grounded generation. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :grounded_generation_service_stub + + ## + # Configure the GroundedGenerationService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GroundedGenerationService clients + # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GroundedGenerationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @grounded_generation_service_stub.universe_domain + end + + ## + # Create a new GroundedGenerationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GroundedGenerationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/grounded_generation_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @grounded_generation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @grounded_generation_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @grounded_generation_service_stub.endpoint + config.universe_domain = @grounded_generation_service_stub.universe_domain + config.logger = @grounded_generation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @grounded_generation_service_stub.logger + end + + # Service calls + + ## + # Generates grounded content in a streaming fashion. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash>] + # An enumerable of {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the stream_generate_grounded_content method to start streaming. + # output = client.stream_generate_grounded_content input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + # input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse + # output.each do |current_response| + # p current_response + # end + # + def stream_generate_grounded_content request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stream_generate_grounded_content.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stream_generate_grounded_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stream_generate_grounded_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @grounded_generation_service_stub.call_rpc :stream_generate_grounded_content, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generates grounded content. + # + # @overload generate_grounded_content(request, options = nil) + # Pass arguments to `generate_grounded_content` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload generate_grounded_content(location: nil, system_instruction: nil, contents: nil, generation_spec: nil, grounding_spec: nil, user_labels: nil) + # Pass arguments to `generate_grounded_content` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param location [::String] + # Required. Location resource. + # + # Format: `projects/{project}/locations/{location}`. + # @param system_instruction [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash] + # Content of the system instruction for the current API. + # + # These instructions will take priority over any other prompt instructions + # if the selected model is supporting them. + # @param contents [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash>] + # Content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec, ::Hash] + # Content generation specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec, ::Hash] + # Grounding specification. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + # + # # Call the generate_grounded_content method. + # result = client.generate_grounded_content request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. + # p result + # + def generate_grounded_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.generate_grounded_content.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.location + header_params["location"] = request.location + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_grounded_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_grounded_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @grounded_generation_service_stub.call_rpc :generate_grounded_content, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs a grounding check. + # + # @overload check_grounding(request, options = nil) + # Pass arguments to `check_grounding` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload check_grounding(grounding_config: nil, answer_candidate: nil, facts: nil, grounding_spec: nil, user_labels: nil) + # Pass arguments to `check_grounding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param grounding_config [::String] + # Required. The resource name of the grounding config, such as + # `projects/*/locations/global/groundingConfigs/default_grounding_config`. + # @param answer_candidate [::String] + # Answer candidate to check. It can have a maximum length of 4096 tokens. + # @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact, ::Hash>] + # List of facts for the grounding check. + # We support up to 200 facts. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec, ::Hash] + # Configuration of the grounding check. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new + # + # # Call the check_grounding method. + # result = client.check_grounding request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. + # p result + # + def check_grounding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.check_grounding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.grounding_config + header_params["grounding_config"] = request.grounding_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.check_grounding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.check_grounding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @grounded_generation_service_stub.call_rpc :check_grounding, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the GroundedGenerationService API. + # + # This class represents the configuration for GroundedGenerationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # stream_generate_grounded_content to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.stream_generate_grounded_content.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.stream_generate_grounded_content.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the GroundedGenerationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `stream_generate_grounded_content` + # @return [::Gapic::Config::Method] + # + attr_reader :stream_generate_grounded_content + ## + # RPC-specific configuration for `generate_grounded_content` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_grounded_content + ## + # RPC-specific configuration for `check_grounding` + # @return [::Gapic::Config::Method] + # + attr_reader :check_grounding + + # @private + def initialize parent_rpcs = nil + stream_generate_grounded_content_config = parent_rpcs.stream_generate_grounded_content if parent_rpcs.respond_to? :stream_generate_grounded_content + @stream_generate_grounded_content = ::Gapic::Config::Method.new stream_generate_grounded_content_config + generate_grounded_content_config = parent_rpcs.generate_grounded_content if parent_rpcs.respond_to? :generate_grounded_content + @generate_grounded_content = ::Gapic::Config::Method.new generate_grounded_content_config + check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding + @check_grounding = ::Gapic::Config::Method.new check_grounding_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb new file mode 100644 index 000000000000..ce9010344e1c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + # Credentials for the GroundedGenerationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb new file mode 100644 index 000000000000..41e9852c971e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + # Path helper methods for the GroundedGenerationService API. + module Paths + ## + # Create a fully-qualified GroundingConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/groundingConfigs/{grounding_config}` + # + # @param project [String] + # @param location [String] + # @param grounding_config [String] + # + # @return [::String] + def grounding_config_path project:, location:, grounding_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/groundingConfigs/#{grounding_config}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified ServingConfig resource string. + # + # @overload serving_config_path(project:, location:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path **args + resources = { + "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb new file mode 100644 index 000000000000..d27abf7a0f61 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/grounded_generation_service/credentials" +require "google/cloud/discovery_engine/v1/grounded_generation_service/paths" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for grounded generation. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new + # + module GroundedGenerationService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb new file mode 100644 index 000000000000..e2615ece6759 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb @@ -0,0 +1,591 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + module Rest + ## + # REST client for the GroundedGenerationService service. + # + # Service for grounded generation. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :grounded_generation_service_stub + + ## + # Configure the GroundedGenerationService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GroundedGenerationService clients + # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GroundedGenerationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @grounded_generation_service_stub.universe_domain + end + + ## + # Create a new GroundedGenerationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GroundedGenerationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @grounded_generation_service_stub = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @grounded_generation_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @grounded_generation_service_stub.endpoint + config.universe_domain = @grounded_generation_service_stub.universe_domain + config.logger = @grounded_generation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @grounded_generation_service_stub.logger + end + + # Service calls + + ## + # Generates grounded content. + # + # @overload generate_grounded_content(request, options = nil) + # Pass arguments to `generate_grounded_content` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload generate_grounded_content(location: nil, system_instruction: nil, contents: nil, generation_spec: nil, grounding_spec: nil, user_labels: nil) + # Pass arguments to `generate_grounded_content` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param location [::String] + # Required. Location resource. + # + # Format: `projects/{project}/locations/{location}`. + # @param system_instruction [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash] + # Content of the system instruction for the current API. + # + # These instructions will take priority over any other prompt instructions + # if the selected model is supporting them. + # @param contents [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash>] + # Content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec, ::Hash] + # Content generation specification. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec, ::Hash] + # Grounding specification. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + # + # # Call the generate_grounded_content method. + # result = client.generate_grounded_content request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. + # p result + # + def generate_grounded_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.generate_grounded_content.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.generate_grounded_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_grounded_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @grounded_generation_service_stub.generate_grounded_content request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs a grounding check. + # + # @overload check_grounding(request, options = nil) + # Pass arguments to `check_grounding` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload check_grounding(grounding_config: nil, answer_candidate: nil, facts: nil, grounding_spec: nil, user_labels: nil) + # Pass arguments to `check_grounding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param grounding_config [::String] + # Required. The resource name of the grounding config, such as + # `projects/*/locations/global/groundingConfigs/default_grounding_config`. + # @param answer_candidate [::String] + # Answer candidate to check. It can have a maximum length of 4096 tokens. + # @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact, ::Hash>] + # List of facts for the grounding check. + # We support up to 200 facts. + # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec, ::Hash] + # Configuration of the grounding check. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new + # + # # Call the check_grounding method. + # result = client.check_grounding request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. + # p result + # + def check_grounding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.check_grounding.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.check_grounding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.check_grounding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @grounded_generation_service_stub.check_grounding request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the GroundedGenerationService REST API. + # + # This class represents the configuration for GroundedGenerationService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # generate_grounded_content to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.generate_grounded_content.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.generate_grounded_content.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the GroundedGenerationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `generate_grounded_content` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_grounded_content + ## + # RPC-specific configuration for `check_grounding` + # @return [::Gapic::Config::Method] + # + attr_reader :check_grounding + + # @private + def initialize parent_rpcs = nil + generate_grounded_content_config = parent_rpcs.generate_grounded_content if parent_rpcs.respond_to? :generate_grounded_content + @generate_grounded_content = ::Gapic::Config::Method.new generate_grounded_content_config + check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding + @check_grounding = ::Gapic::Config::Method.new check_grounding_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb new file mode 100644 index 000000000000..9f8f6c3b7a7e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + module Rest + ## + # REST service stub for the GroundedGenerationService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the generate_grounded_content REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] + # A result object deserialized from the server's reply + def generate_grounded_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_grounded_content_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "generate_grounded_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the check_grounding REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] + # A result object deserialized from the server's reply + def check_grounding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_check_grounding_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "check_grounding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_grounded_content REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_generate_grounded_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{location}:generateGroundedContent", + body: "*", + matches: [ + ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the check_grounding REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_check_grounding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{grounding_config}:check", + body: "*", + matches: [ + ["grounding_config", %r{^projects/[^/]+/locations/[^/]+/groundingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb new file mode 100644 index 000000000000..758f8fea5e26 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/paths" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/operations" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/client" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Identity Mapping Stores. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/identity_mapping_store_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + module IdentityMappingStoreService + end + end + end + end +end + +helper_path = ::File.join __dir__, "identity_mapping_store_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb new file mode 100644 index 000000000000..a125b98068fb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb @@ -0,0 +1,1177 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + ## + # Client for the IdentityMappingStoreService service. + # + # Service for managing Identity Mapping Stores. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :identity_mapping_store_service_stub + + ## + # Configure the IdentityMappingStoreService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IdentityMappingStoreService clients + # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IdentityMappingStoreService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @identity_mapping_store_service_stub.universe_domain + end + + ## + # Create a new IdentityMappingStoreService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IdentityMappingStoreService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @identity_mapping_store_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @identity_mapping_store_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @identity_mapping_store_service_stub.endpoint + config.universe_domain = @identity_mapping_store_service_stub.universe_domain + config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @identity_mapping_store_service_stub.logger + end + + # Service calls + + ## + # Creates a new Identity Mapping Store. + # + # @overload create_identity_mapping_store(request, options = nil) + # Pass arguments to `create_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil) + # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cmek_config_name [::String] + # Resource name of the CmekConfig to use for protecting this Identity + # Mapping Store. + # + # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disable_cmek [::Boolean] + # Identity Mapping Store without CMEK protections. If a default CmekConfig + # is set for the project, setting this field will override the default + # CmekConfig as well. + # + # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent collection resource name, such as + # `projects/{project}/locations/{location}`. + # @param identity_mapping_store_id [::String] + # Required. The ID of the Identity Mapping Store to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + # (_), and hyphens (-). The maximum length is 63 characters. + # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash] + # Required. The Identity Mapping Store to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new + # + # # Call the create_identity_mapping_store method. + # result = client.create_identity_mapping_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p result + # + def create_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :create_identity_mapping_store, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the Identity Mapping Store. + # + # @overload get_identity_mapping_store(request, options = nil) + # Pass arguments to `get_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_identity_mapping_store(name: nil) + # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Identity Mapping Store to get. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new + # + # # Call the get_identity_mapping_store method. + # result = client.get_identity_mapping_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p result + # + def get_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :get_identity_mapping_store, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the Identity Mapping Store. + # + # @overload delete_identity_mapping_store(request, options = nil) + # Pass arguments to `delete_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_identity_mapping_store(name: nil) + # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Identity Mapping Store to delete. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new + # + # # Call the delete_identity_mapping_store method. + # result = client.delete_identity_mapping_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :delete_identity_mapping_store, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports a list of Identity Mapping Entries to an Identity Mapping Store. + # + # @overload import_identity_mappings(request, options = nil) + # Pass arguments to `import_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil) + # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash] + # The inline source to import identity mapping entries from. + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to import Identity Mapping + # Entries to. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new + # + # # Call the import_identity_mappings method. + # result = client.import_identity_mappings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.identity_mapping_store + header_params["identity_mapping_store"] = request.identity_mapping_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :import_identity_mappings, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges specified or all Identity Mapping Entries from an Identity Mapping + # Store. + # + # @overload purge_identity_mappings(request, options = nil) + # Pass arguments to `purge_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil) + # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash] + # The inline source to purge identity mapping entries from. + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to purge Identity Mapping + # Entries from. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @param filter [::String] + # Filter matching identity mappings to purge. + # The eligible field for filtering is: + # * `update_time`: in ISO 8601 "zulu" format. + # * `external_id` + # + # Examples: + # + # * Deleting all identity mappings updated in a time range: + # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < + # "2012-04-23T18:30:43.511Z"` + # * Deleting all identity mappings for a given external_id: + # `external_id = "id1"` + # * Deleting all identity mappings inside an identity mapping store: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # Should not be used with source. An error will be thrown, if both are + # provided. + # @param force [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any identity mappings. This field is + # only supported for purge with filter. For input source this field is + # ignored and data will be purged regardless of the value of this field. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new + # + # # Call the purge_identity_mappings method. + # result = client.purge_identity_mappings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.purge_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.identity_mapping_store + header_params["identity_mapping_store"] = request.identity_mapping_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :purge_identity_mappings, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Identity Mappings in an Identity Mapping Store. + # + # @overload list_identity_mappings(request, options = nil) + # Pass arguments to `list_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to list Identity Mapping + # Entries in. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @param page_size [::Integer] + # Maximum number of IdentityMappings to return. If unspecified, defaults + # to 2000. The maximum allowed value is 10000. Values above 10000 will be + # coerced to 10000. + # @param page_token [::String] + # A page token, received from a previous `ListIdentityMappings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappings` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new + # + # # Call the list_identity_mappings method. + # result = client.list_identity_mappings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. + # p item + # end + # + def list_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.identity_mapping_store + header_params["identity_mapping_store"] = request.identity_mapping_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :list_identity_mappings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Identity Mapping Stores. + # + # @overload list_identity_mapping_stores(request, options = nil) + # Pass arguments to `list_identity_mapping_stores` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent of the Identity Mapping Stores to list. + # Format: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Maximum number of IdentityMappingStores to return. If unspecified, defaults + # to 100. The maximum allowed value is 1000. Values above 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListIdentityMappingStores` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappingStores` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new + # + # # Call the list_identity_mapping_stores method. + # result = client.list_identity_mapping_stores request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p item + # end + # + def list_identity_mapping_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.call_rpc :list_identity_mapping_stores, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the IdentityMappingStoreService API. + # + # This class represents the configuration for IdentityMappingStoreService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_identity_mapping_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_identity_mapping_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_identity_mapping_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the IdentityMappingStoreService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_identity_mapping_store + ## + # RPC-specific configuration for `get_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_identity_mapping_store + ## + # RPC-specific configuration for `delete_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_identity_mapping_store + ## + # RPC-specific configuration for `import_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :import_identity_mappings + ## + # RPC-specific configuration for `purge_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_identity_mappings + ## + # RPC-specific configuration for `list_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_identity_mappings + ## + # RPC-specific configuration for `list_identity_mapping_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_identity_mapping_stores + + # @private + def initialize parent_rpcs = nil + create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store + @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config + get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store + @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config + delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store + @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config + import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings + @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config + purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings + @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config + list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings + @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config + list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores + @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb new file mode 100644 index 000000000000..96ab6e178be7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + # Credentials for the IdentityMappingStoreService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb new file mode 100644 index 000000000000..99f4cfcfa0c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the IdentityMappingStoreService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the IdentityMappingStoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb new file mode 100644 index 000000000000..17ad1ea56488 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + # Path helper methods for the IdentityMappingStoreService API. + module Paths + ## + # Create a fully-qualified CmekConfig resource string. + # + # @overload cmek_config_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfig` + # + # @param project [String] + # @param location [String] + # + # @overload cmek_config_path(project:, location:, cmek_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` + # + # @param project [String] + # @param location [String] + # @param cmek_config [String] + # + # @return [::String] + def cmek_config_path **args + resources = { + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfig" + end), + "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified CryptoKeyVersions resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified CryptoKeys resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_keys_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified IdentityMappingStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}` + # + # @param project [String] + # @param location [String] + # @param identity_mapping_store [String] + # + # @return [::String] + def identity_mapping_store_path project:, location:, identity_mapping_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/identityMappingStores/#{identity_mapping_store}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb new file mode 100644 index 000000000000..e4278ea8733b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/paths" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Identity Mapping Stores. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + module IdentityMappingStoreService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb new file mode 100644 index 000000000000..6efcf137c7fe --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb @@ -0,0 +1,1085 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + module Rest + ## + # REST client for the IdentityMappingStoreService service. + # + # Service for managing Identity Mapping Stores. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :identity_mapping_store_service_stub + + ## + # Configure the IdentityMappingStoreService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IdentityMappingStoreService clients + # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IdentityMappingStoreService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @identity_mapping_store_service_stub.universe_domain + end + + ## + # Create a new IdentityMappingStoreService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IdentityMappingStoreService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @identity_mapping_store_service_stub = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @identity_mapping_store_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @identity_mapping_store_service_stub.endpoint + config.universe_domain = @identity_mapping_store_service_stub.universe_domain + config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @identity_mapping_store_service_stub.logger + end + + # Service calls + + ## + # Creates a new Identity Mapping Store. + # + # @overload create_identity_mapping_store(request, options = nil) + # Pass arguments to `create_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil) + # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cmek_config_name [::String] + # Resource name of the CmekConfig to use for protecting this Identity + # Mapping Store. + # + # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param disable_cmek [::Boolean] + # Identity Mapping Store without CMEK protections. If a default CmekConfig + # is set for the project, setting this field will override the default + # CmekConfig as well. + # + # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. The parent collection resource name, such as + # `projects/{project}/locations/{location}`. + # @param identity_mapping_store_id [::String] + # Required. The ID of the Identity Mapping Store to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + # (_), and hyphens (-). The maximum length is 63 characters. + # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash] + # Required. The Identity Mapping Store to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new + # + # # Call the create_identity_mapping_store method. + # result = client.create_identity_mapping_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p result + # + def create_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.create_identity_mapping_store request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the Identity Mapping Store. + # + # @overload get_identity_mapping_store(request, options = nil) + # Pass arguments to `get_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_identity_mapping_store(name: nil) + # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Identity Mapping Store to get. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new + # + # # Call the get_identity_mapping_store method. + # result = client.get_identity_mapping_store request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p result + # + def get_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.get_identity_mapping_store request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the Identity Mapping Store. + # + # @overload delete_identity_mapping_store(request, options = nil) + # Pass arguments to `delete_identity_mapping_store` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_identity_mapping_store(name: nil) + # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Identity Mapping Store to delete. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new + # + # # Call the delete_identity_mapping_store method. + # result = client.delete_identity_mapping_store request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_identity_mapping_store request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.delete_identity_mapping_store request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports a list of Identity Mapping Entries to an Identity Mapping Store. + # + # @overload import_identity_mappings(request, options = nil) + # Pass arguments to `import_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil) + # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash] + # The inline source to import identity mapping entries from. + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to import Identity Mapping + # Entries to. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new + # + # # Call the import_identity_mappings method. + # result = client.import_identity_mappings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.import_identity_mappings request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges specified or all Identity Mapping Entries from an Identity Mapping + # Store. + # + # @overload purge_identity_mappings(request, options = nil) + # Pass arguments to `purge_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil) + # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash] + # The inline source to purge identity mapping entries from. + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to purge Identity Mapping + # Entries from. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @param filter [::String] + # Filter matching identity mappings to purge. + # The eligible field for filtering is: + # * `update_time`: in ISO 8601 "zulu" format. + # * `external_id` + # + # Examples: + # + # * Deleting all identity mappings updated in a time range: + # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < + # "2012-04-23T18:30:43.511Z"` + # * Deleting all identity mappings for a given external_id: + # `external_id = "id1"` + # * Deleting all identity mappings inside an identity mapping store: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # Should not be used with source. An error will be thrown, if both are + # provided. + # @param force [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any identity mappings. This field is + # only supported for purge with filter. For input source this field is + # ignored and data will be purged regardless of the value of this field. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new + # + # # Call the purge_identity_mappings method. + # result = client.purge_identity_mappings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.purge_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.purge_identity_mappings request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Identity Mappings in an Identity Mapping Store. + # + # @overload list_identity_mappings(request, options = nil) + # Pass arguments to `list_identity_mappings` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param identity_mapping_store [::String] + # Required. The name of the Identity Mapping Store to list Identity Mapping + # Entries in. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @param page_size [::Integer] + # Maximum number of IdentityMappings to return. If unspecified, defaults + # to 2000. The maximum allowed value is 10000. Values above 10000 will be + # coerced to 10000. + # @param page_token [::String] + # A page token, received from a previous `ListIdentityMappings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappings` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new + # + # # Call the list_identity_mappings method. + # result = client.list_identity_mappings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. + # p item + # end + # + def list_identity_mappings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_identity_mappings.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_identity_mappings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.list_identity_mappings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, "identity_mapping_entries", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Identity Mapping Stores. + # + # @overload list_identity_mapping_stores(request, options = nil) + # Pass arguments to `list_identity_mapping_stores` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent of the Identity Mapping Stores to list. + # Format: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Maximum number of IdentityMappingStores to return. If unspecified, defaults + # to 100. The maximum allowed value is 1000. Values above 1000 will be + # coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListIdentityMappingStores` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappingStores` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new + # + # # Call the list_identity_mapping_stores method. + # result = client.list_identity_mapping_stores request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + # p item + # end + # + def list_identity_mapping_stores request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @identity_mapping_store_service_stub.list_identity_mapping_stores request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, "identity_mapping_stores", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the IdentityMappingStoreService REST API. + # + # This class represents the configuration for IdentityMappingStoreService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_identity_mapping_store to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_identity_mapping_store.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_identity_mapping_store.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the IdentityMappingStoreService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :create_identity_mapping_store + ## + # RPC-specific configuration for `get_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :get_identity_mapping_store + ## + # RPC-specific configuration for `delete_identity_mapping_store` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_identity_mapping_store + ## + # RPC-specific configuration for `import_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :import_identity_mappings + ## + # RPC-specific configuration for `purge_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_identity_mappings + ## + # RPC-specific configuration for `list_identity_mappings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_identity_mappings + ## + # RPC-specific configuration for `list_identity_mapping_stores` + # @return [::Gapic::Config::Method] + # + attr_reader :list_identity_mapping_stores + + # @private + def initialize parent_rpcs = nil + create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store + @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config + get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store + @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config + delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store + @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config + import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings + @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config + purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings + @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config + list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings + @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config + list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores + @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb new file mode 100644 index 000000000000..25e058f04d93 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the IdentityMappingStoreService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the IdentityMappingStoreService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb new file mode 100644 index 000000000000..4122c1d96cbc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb @@ -0,0 +1,511 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + module Rest + ## + # REST service stub for the IdentityMappingStoreService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # A result object deserialized from the server's reply + def create_identity_mapping_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_identity_mapping_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_identity_mapping_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # A result object deserialized from the server's reply + def get_identity_mapping_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_identity_mapping_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_identity_mapping_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_identity_mapping_store request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_identity_mapping_store_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_identity_mapping_store", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_identity_mappings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_identity_mappings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_identity_mappings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def purge_identity_mappings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_identity_mappings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "purge_identity_mappings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse] + # A result object deserialized from the server's reply + def list_identity_mappings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_identity_mappings_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_identity_mappings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_identity_mapping_stores REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse] + # A result object deserialized from the server's reply + def list_identity_mapping_stores request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_identity_mapping_stores_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_identity_mapping_stores", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_identity_mapping_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/identityMappingStores", + body: "identity_mapping_store", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_identity_mapping_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_identity_mapping_store REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_identity_mapping_store_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_identity_mappings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{identity_mapping_store}:importIdentityMappings", + body: "*", + matches: [ + ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_identity_mappings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{identity_mapping_store}:purgeIdentityMappings", + body: "*", + matches: [ + ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_identity_mappings REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_identity_mappings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{identity_mapping_store}:listIdentityMappings", + matches: [ + ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_identity_mapping_stores REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_identity_mapping_stores_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/identityMappingStores", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb new file mode 100644 index 000000000000..7be3f306beb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/project_service/credentials" +require "google/cloud/discovery_engine/v1/project_service/paths" +require "google/cloud/discovery_engine/v1/project_service/operations" +require "google/cloud/discovery_engine/v1/project_service/client" +require "google/cloud/discovery_engine/v1/project_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for operations on the + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/project_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/project_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new + # + module ProjectService + end + end + end + end +end + +helper_path = ::File.join __dir__, "project_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/project_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb new file mode 100644 index 000000000000..6d193af7d00c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/project_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + ## + # Client for the ProjectService service. + # + # Service for operations on the + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :project_service_stub + + ## + # Configure the ProjectService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProjectService clients + # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProjectService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @project_service_stub.universe_domain + end + + ## + # Create a new ProjectService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProjectService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/project_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @project_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @project_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @project_service_stub.endpoint + config.universe_domain = @project_service_stub.universe_domain + config.logger = @project_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @project_service_stub.logger + end + + # Service calls + + ## + # Provisions the project resource. During the + # process, related systems will get prepared and initialized. + # + # Caller must read the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms), and optionally + # specify in request to provide consent to that service terms. + # + # @overload provision_project(request, options = nil) + # Pass arguments to `provision_project` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload provision_project(name: nil, accept_data_use_terms: nil, data_use_terms_version: nil) + # Pass arguments to `provision_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as + # `projects/{project_id_or_number}`. + # @param accept_data_use_terms [::Boolean] + # Required. Set to `true` to specify that caller has read and would like to + # give consent to the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms). + # @param data_use_terms_version [::String] + # Required. The version of the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms) that caller has read + # and would like to give consent to. + # + # Acceptable version is `2022-11-23`, and this may change over time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new + # + # # Call the provision_project method. + # result = client.provision_project request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def provision_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.provision_project.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.provision_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.provision_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @project_service_stub.call_rpc :provision_project, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ProjectService API. + # + # This class represents the configuration for ProjectService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # provision_project to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.provision_project.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.provision_project.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ProjectService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `provision_project` + # @return [::Gapic::Config::Method] + # + attr_reader :provision_project + + # @private + def initialize parent_rpcs = nil + provision_project_config = parent_rpcs.provision_project if parent_rpcs.respond_to? :provision_project + @provision_project = ::Gapic::Config::Method.new provision_project_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb new file mode 100644 index 000000000000..56221ceb0943 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + # Credentials for the ProjectService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb new file mode 100644 index 000000000000..1ca54e3470f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProjectService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ProjectService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb new file mode 100644 index 000000000000..b8da2cb8502d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + # Path helper methods for the ProjectService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb new file mode 100644 index 000000000000..a3427490520d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/project_service/credentials" +require "google/cloud/discovery_engine/v1/project_service/paths" +require "google/cloud/discovery_engine/v1/project_service/rest/operations" +require "google/cloud/discovery_engine/v1/project_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for operations on the + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/project_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new + # + module ProjectService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/project_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb new file mode 100644 index 000000000000..2a2b0ce19473 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb @@ -0,0 +1,486 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/project_service_pb" +require "google/cloud/discovery_engine/v1/project_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + module Rest + ## + # REST client for the ProjectService service. + # + # Service for operations on the + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :project_service_stub + + ## + # Configure the ProjectService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProjectService clients + # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProjectService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @project_service_stub.universe_domain + end + + ## + # Create a new ProjectService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProjectService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @project_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @project_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @project_service_stub.endpoint + config.universe_domain = @project_service_stub.universe_domain + config.logger = @project_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @project_service_stub.logger + end + + # Service calls + + ## + # Provisions the project resource. During the + # process, related systems will get prepared and initialized. + # + # Caller must read the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms), and optionally + # specify in request to provide consent to that service terms. + # + # @overload provision_project(request, options = nil) + # Pass arguments to `provision_project` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload provision_project(name: nil, accept_data_use_terms: nil, data_use_terms_version: nil) + # Pass arguments to `provision_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as + # `projects/{project_id_or_number}`. + # @param accept_data_use_terms [::Boolean] + # Required. Set to `true` to specify that caller has read and would like to + # give consent to the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms). + # @param data_use_terms_version [::String] + # Required. The version of the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms) that caller has read + # and would like to give consent to. + # + # Acceptable version is `2022-11-23`, and this may change over time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new + # + # # Call the provision_project method. + # result = client.provision_project request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def provision_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.provision_project.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.provision_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.provision_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @project_service_stub.provision_project request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ProjectService REST API. + # + # This class represents the configuration for ProjectService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # provision_project to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.provision_project.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.provision_project.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ProjectService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `provision_project` + # @return [::Gapic::Config::Method] + # + attr_reader :provision_project + + # @private + def initialize parent_rpcs = nil + provision_project_config = parent_rpcs.provision_project if parent_rpcs.respond_to? :provision_project + @provision_project = ::Gapic::Config::Method.new provision_project_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb new file mode 100644 index 000000000000..a104f592a062 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProjectService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ProjectService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb new file mode 100644 index 000000000000..3810371e874d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/project_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + module Rest + ## + # REST service stub for the ProjectService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the provision_project REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def provision_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_provision_project_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "provision_project", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the provision_project REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_provision_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:provision", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb new file mode 100644 index 000000000000..001d9b54d2df --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/rank_service/credentials" +require "google/cloud/discovery_engine/v1/rank_service/paths" +require "google/cloud/discovery_engine/v1/rank_service/client" +require "google/cloud/discovery_engine/v1/rank_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ranking text records. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/rank_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/rank_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new + # + module RankService + end + end + end + end +end + +helper_path = ::File.join __dir__, "rank_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/rank_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb new file mode 100644 index 000000000000..c7e3d2b80483 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb @@ -0,0 +1,531 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/rank_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + ## + # Client for the RankService service. + # + # Service for ranking text records. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :rank_service_stub + + ## + # Configure the RankService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RankService clients + # ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RankService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @rank_service_stub.universe_domain + end + + ## + # Create a new RankService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RankService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/rank_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @rank_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::RankService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @rank_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @rank_service_stub.endpoint + config.universe_domain = @rank_service_stub.universe_domain + config.logger = @rank_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @rank_service_stub.logger + end + + # Service calls + + ## + # Ranks a list of text records based on the given input query. + # + # @overload rank(request, options = nil) + # Pass arguments to `rank` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RankRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil) + # Pass arguments to `rank` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ranking_config [::String] + # Required. The resource name of the rank service config, such as + # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. + # @param model [::String] + # The identifier of the model to use. It is one of: + # + # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input + # token size 512. + # + # It is set to `semantic-ranker-512@latest` by default if unspecified. + # @param top_n [::Integer] + # The number of results to return. If this is unset or no bigger than zero, + # returns all results. + # @param query [::String] + # The query to use. + # @param records [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord, ::Hash>] + # Required. A list of records to rank. At most 200 records to rank. + # @param ignore_record_details_in_response [::Boolean] + # If true, the response will contain only record ID and score. By default, it + # is false, the response will contain record details. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::RankService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new + # + # # Call the rank method. + # result = client.rank request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. + # p result + # + def rank request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RankRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.rank.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.ranking_config + header_params["ranking_config"] = request.ranking_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rank.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rank.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rank_service_stub.call_rpc :rank, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RankService API. + # + # This class represents the configuration for RankService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # rank to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.rank.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.rank.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RankService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `rank` + # @return [::Gapic::Config::Method] + # + attr_reader :rank + + # @private + def initialize parent_rpcs = nil + rank_config = parent_rpcs.rank if parent_rpcs.respond_to? :rank + @rank = ::Gapic::Config::Method.new rank_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb new file mode 100644 index 000000000000..aa1cf428231a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + # Credentials for the RankService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb new file mode 100644 index 000000000000..3572501fb9b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + # Path helper methods for the RankService API. + module Paths + ## + # Create a fully-qualified RankingConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/rankingConfigs/{ranking_config}` + # + # @param project [String] + # @param location [String] + # @param ranking_config [String] + # + # @return [::String] + def ranking_config_path project:, location:, ranking_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/rankingConfigs/#{ranking_config}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb new file mode 100644 index 000000000000..cbd7c266f04c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/rank_service/credentials" +require "google/cloud/discovery_engine/v1/rank_service/paths" +require "google/cloud/discovery_engine/v1/rank_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ranking text records. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/rank_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new + # + module RankService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/rank_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb new file mode 100644 index 000000000000..7eedeb32e946 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb @@ -0,0 +1,481 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/rank_service_pb" +require "google/cloud/discovery_engine/v1/rank_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + module Rest + ## + # REST client for the RankService service. + # + # Service for ranking text records. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :rank_service_stub + + ## + # Configure the RankService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RankService clients + # ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RankService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @rank_service_stub.universe_domain + end + + ## + # Create a new RankService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RankService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @rank_service_stub = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @rank_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @rank_service_stub.endpoint + config.universe_domain = @rank_service_stub.universe_domain + config.logger = @rank_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @rank_service_stub.logger + end + + # Service calls + + ## + # Ranks a list of text records based on the given input query. + # + # @overload rank(request, options = nil) + # Pass arguments to `rank` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RankRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil) + # Pass arguments to `rank` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param ranking_config [::String] + # Required. The resource name of the rank service config, such as + # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. + # @param model [::String] + # The identifier of the model to use. It is one of: + # + # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input + # token size 512. + # + # It is set to `semantic-ranker-512@latest` by default if unspecified. + # @param top_n [::Integer] + # The number of results to return. If this is unset or no bigger than zero, + # returns all results. + # @param query [::String] + # The query to use. + # @param records [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord, ::Hash>] + # Required. A list of records to rank. At most 200 records to rank. + # @param ignore_record_details_in_response [::Boolean] + # If true, the response will contain only record ID and score. By default, it + # is false, the response will contain record details. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new + # + # # Call the rank method. + # result = client.rank request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. + # p result + # + def rank request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RankRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.rank.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rank.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rank.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @rank_service_stub.rank request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RankService REST API. + # + # This class represents the configuration for RankService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # rank to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.rank.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.rank.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the RankService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `rank` + # @return [::Gapic::Config::Method] + # + attr_reader :rank + + # @private + def initialize parent_rpcs = nil + rank_config = parent_rpcs.rank if parent_rpcs.respond_to? :rank + @rank = ::Gapic::Config::Method.new rank_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb new file mode 100644 index 000000000000..9219fbde7576 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/rank_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + module Rest + ## + # REST service stub for the RankService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the rank REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RankRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] + # A result object deserialized from the server's reply + def rank request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rank_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "rank", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the rank REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RankRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rank_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{ranking_config}:rank", + body: "*", + matches: [ + ["ranking_config", %r{^projects/[^/]+/locations/[^/]+/rankingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb new file mode 100644 index 000000000000..7fb8b2b8faf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/recommendation_service/credentials" +require "google/cloud/discovery_engine/v1/recommendation_service/paths" +require "google/cloud/discovery_engine/v1/recommendation_service/client" +require "google/cloud/discovery_engine/v1/recommendation_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for making recommendations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/recommendation_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/recommendation_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new + # + module RecommendationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "recommendation_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/recommendation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb new file mode 100644 index 000000000000..50ba0d7ae98d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb @@ -0,0 +1,609 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/recommendation_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RecommendationService + ## + # Client for the RecommendationService service. + # + # Service for making recommendations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommendation_service_stub + + ## + # Configure the RecommendationService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecommendationService clients + # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecommendationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recommendation_service_stub.universe_domain + end + + ## + # Create a new RecommendationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecommendationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/recommendation_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @recommendation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @recommendation_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @recommendation_service_stub.endpoint + config.universe_domain = @recommendation_service_stub.universe_domain + config.logger = @recommendation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @recommendation_service_stub.logger + end + + # Service calls + + ## + # Makes a recommendation, which requires a contextual user event. + # + # @overload recommend(request, options = nil) + # Pass arguments to `recommend` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recommend(serving_config: nil, user_event: nil, page_size: nil, filter: nil, validate_only: nil, params: nil, user_labels: nil) + # Pass arguments to `recommend` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: + # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or + # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` + # + # One default serving config is created along with your recommendation engine + # creation. The engine ID is used as the ID of the default serving + # config. For example, for Engine + # `projects/*/locations/global/collections/*/engines/my-engine`, you can use + # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` + # for your + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend} + # requests. + # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # or + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # to a random unique ID and leave + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} + # unset. + # @param page_size [::Integer] + # Maximum number of results to return. Set this property + # to the number of recommendation results needed. If zero, the service + # chooses a reasonable default. The maximum allowed value is 100. Values + # above 100 are set to 100. + # @param filter [::String] + # 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: + # + # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) + # * (available: true) AND + # (language: ANY("en", "es")) OR (categories: ANY("Movie")) + # + # If your filter blocks all results, the API returns generic + # (unfiltered) popular Documents. If you only want results strictly matching + # the filters, set `strictFiltering` to `true` in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} + # to receive empty results instead. + # + # Note that the API never returns + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` + # as `EXPIRED` or `DELETED` regardless of filter choices. + # @param validate_only [::Boolean] + # Use validate only mode for this recommendation query. If set to `true`, a + # fake model is 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. + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # Additional domain specific parameters for the recommendations. + # + # Allowed values: + # + # * `returnDocument`: Boolean. If set to `true`, the associated Document + # object is returned in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. + # * `returnScore`: Boolean. If set to true, the recommendation score + # corresponding to each returned Document is set in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 + # returns 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. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new + # + # # Call the recommend method. + # result = client.recommend request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. + # p result + # + def recommend request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.recommend.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.recommend.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recommend.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_service_stub.call_rpc :recommend, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RecommendationService API. + # + # This class represents the configuration for RecommendationService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recommend to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recommend.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recommend.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the RecommendationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recommend` + # @return [::Gapic::Config::Method] + # + attr_reader :recommend + + # @private + def initialize parent_rpcs = nil + recommend_config = parent_rpcs.recommend if parent_rpcs.respond_to? :recommend + @recommend = ::Gapic::Config::Method.new recommend_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb new file mode 100644 index 000000000000..bb77b81ac23c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RecommendationService + # Credentials for the RecommendationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb new file mode 100644 index 000000000000..b0938c55ce09 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb @@ -0,0 +1,220 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RecommendationService + # Path helper methods for the RecommendationService API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Engine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # + # @return [::String] + def engine_path project:, location:, collection:, engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" + end + + ## + # Create a fully-qualified ServingConfig resource string. + # + # @overload serving_config_path(project:, location:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path **args + resources = { + "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb new file mode 100644 index 000000000000..ef121eb8536a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/recommendation_service/credentials" +require "google/cloud/discovery_engine/v1/recommendation_service/paths" +require "google/cloud/discovery_engine/v1/recommendation_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for making recommendations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/recommendation_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new + # + module RecommendationService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/recommendation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb new file mode 100644 index 000000000000..af317913f3cd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb @@ -0,0 +1,559 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/recommendation_service_pb" +require "google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RecommendationService + module Rest + ## + # REST client for the RecommendationService service. + # + # Service for making recommendations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :recommendation_service_stub + + ## + # Configure the RecommendationService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all RecommendationService clients + # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 5.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the RecommendationService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @recommendation_service_stub.universe_domain + end + + ## + # Create a new RecommendationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the RecommendationService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @recommendation_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @recommendation_service_stub.endpoint + config.universe_domain = @recommendation_service_stub.universe_domain + config.logger = @recommendation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @recommendation_service_stub.logger + end + + # Service calls + + ## + # Makes a recommendation, which requires a contextual user event. + # + # @overload recommend(request, options = nil) + # Pass arguments to `recommend` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recommend(serving_config: nil, user_event: nil, page_size: nil, filter: nil, validate_only: nil, params: nil, user_labels: nil) + # Pass arguments to `recommend` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: + # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or + # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` + # + # One default serving config is created along with your recommendation engine + # creation. The engine ID is used as the ID of the default serving + # config. For example, for Engine + # `projects/*/locations/global/collections/*/engines/my-engine`, you can use + # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` + # for your + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client#recommend RecommendationService.Recommend} + # requests. + # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # or + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # to a random unique ID and leave + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} + # unset. + # @param page_size [::Integer] + # Maximum number of results to return. Set this property + # to the number of recommendation results needed. If zero, the service + # chooses a reasonable default. The maximum allowed value is 100. Values + # above 100 are set to 100. + # @param filter [::String] + # 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: + # + # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) + # * (available: true) AND + # (language: ANY("en", "es")) OR (categories: ANY("Movie")) + # + # If your filter blocks all results, the API returns generic + # (unfiltered) popular Documents. If you only want results strictly matching + # the filters, set `strictFiltering` to `true` in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} + # to receive empty results instead. + # + # Note that the API never returns + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` + # as `EXPIRED` or `DELETED` regardless of filter choices. + # @param validate_only [::Boolean] + # Use validate only mode for this recommendation query. If set to `true`, a + # fake model is 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. + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # Additional domain specific parameters for the recommendations. + # + # Allowed values: + # + # * `returnDocument`: Boolean. If set to `true`, the associated Document + # object is returned in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. + # * `returnScore`: Boolean. If set to true, the recommendation score + # corresponding to each returned Document is set in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 + # returns 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. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new + # + # # Call the recommend method. + # result = client.recommend request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. + # p result + # + def recommend request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.recommend.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recommend.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recommend.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @recommendation_service_stub.recommend request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the RecommendationService REST API. + # + # This class represents the configuration for RecommendationService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # recommend to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.recommend.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.recommend.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the RecommendationService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `recommend` + # @return [::Gapic::Config::Method] + # + attr_reader :recommend + + # @private + def initialize parent_rpcs = nil + recommend_config = parent_rpcs.recommend if parent_rpcs.respond_to? :recommend + @recommend = ::Gapic::Config::Method.new recommend_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb new file mode 100644 index 000000000000..b7bcb64300e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/recommendation_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RecommendationService + module Rest + ## + # REST service stub for the RecommendationService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the recommend REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] + # A result object deserialized from the server's reply + def recommend request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recommend_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "recommend", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the recommend REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recommend_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:recommend", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:recommend", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:recommend", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb new file mode 100644 index 000000000000..24a9ce23296b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discovery_engine/v1/search_service/rest" +require "google/cloud/discovery_engine/v1/assistant_service/rest" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest" +require "google/cloud/discovery_engine/v1/completion_service/rest" +require "google/cloud/discovery_engine/v1/control_service/rest" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest" +require "google/cloud/discovery_engine/v1/data_store_service/rest" +require "google/cloud/discovery_engine/v1/document_service/rest" +require "google/cloud/discovery_engine/v1/engine_service/rest" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" +require "google/cloud/discovery_engine/v1/project_service/rest" +require "google/cloud/discovery_engine/v1/rank_service/rest" +require "google/cloud/discovery_engine/v1/recommendation_service/rest" +require "google/cloud/discovery_engine/v1/schema_service/rest" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest" +require "google/cloud/discovery_engine/v1/serving_config_service/rest" +require "google/cloud/discovery_engine/v1/session_service/rest" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" +require "google/cloud/discovery_engine/v1/user_event_service/rest" +require "google/cloud/discovery_engine/v1/user_license_service/rest" +require "google/cloud/discovery_engine/v1/version" + +module Google + module Cloud + module DiscoveryEngine + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/discovery_engine/v1/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb new file mode 100644 index 000000000000..2b84f6382d99 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/schema_service/credentials" +require "google/cloud/discovery_engine/v1/schema_service/paths" +require "google/cloud/discovery_engine/v1/schema_service/operations" +require "google/cloud/discovery_engine/v1/schema_service/client" +require "google/cloud/discovery_engine/v1/schema_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/schema_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/schema_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + module SchemaService + end + end + end + end +end + +helper_path = ::File.join __dir__, "schema_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/schema_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb new file mode 100644 index 000000000000..7dce08dc94fc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb @@ -0,0 +1,945 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/schema_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + ## + # Client for the SchemaService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :schema_service_stub + + ## + # Configure the SchemaService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SchemaService clients + # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SchemaService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @schema_service_stub.universe_domain + end + + ## + # Create a new SchemaService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SchemaService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/schema_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @schema_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @schema_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + config.logger = @schema_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @schema_service_stub.logger + end + + # Service calls + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload get_schema(request, options = nil) + # Pass arguments to `get_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_schema(name: nil) + # Pass arguments to `get_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Schema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new + # + # # Call the get_schema method. + # result = client.get_schema request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. + # p result + # + def get_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :get_schema, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + # @overload list_schemas(request, options = nil) + # Pass arguments to `list_schemas` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_schemas(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_schemas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @param page_size [::Integer] + # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to + # return. The service may return fewer than this value. + # + # If unspecified, at most 100 + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. + # + # The maximum value is 1000; values above 1000 are set to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new + # + # # Call the list_schemas method. + # result = client.list_schemas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. + # p item + # end + # + def list_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_schemas.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload create_schema(request, options = nil) + # Pass arguments to `create_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_schema(parent: nil, schema: nil, schema_id: nil) + # Pass arguments to `create_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. + # @param schema_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final + # component of the + # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. + # + # This field should conform to + # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + # limit of 63 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new + # + # # Call the create_schema method. + # result = client.create_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :create_schema, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload update_schema(request, options = nil) + # Pass arguments to `update_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_schema(schema: nil, allow_missing: nil) + # Pass arguments to `update_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # created. In this situation, `update_mask` is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new + # + # # Call the update_schema method. + # result = client.update_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.schema&.name + header_params["schema.name"] = request.schema.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :update_schema, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload delete_schema(request, options = nil) + # Pass arguments to `delete_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_schema(name: nil) + # Pass arguments to `delete_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new + # + # # Call the delete_schema method. + # result = client.delete_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SchemaService API. + # + # This class represents the configuration for SchemaService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_schema to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_schema.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_schema.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SchemaService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_schema + ## + # RPC-specific configuration for `list_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schemas + ## + # RPC-specific configuration for `create_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_schema + ## + # RPC-specific configuration for `update_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_schema + ## + # RPC-specific configuration for `delete_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schema + + # @private + def initialize parent_rpcs = nil + get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema + @get_schema = ::Gapic::Config::Method.new get_schema_config + list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas + @list_schemas = ::Gapic::Config::Method.new list_schemas_config + create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema + @create_schema = ::Gapic::Config::Method.new create_schema_config + update_schema_config = parent_rpcs.update_schema if parent_rpcs.respond_to? :update_schema + @update_schema = ::Gapic::Config::Method.new update_schema_config + delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema + @delete_schema = ::Gapic::Config::Method.new delete_schema_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb new file mode 100644 index 000000000000..c8bc21ee6abf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + # Credentials for the SchemaService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb new file mode 100644 index 000000000000..316822fee1af --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SchemaService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SchemaService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb new file mode 100644 index 000000000000..c0a1da46a919 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + # Path helper methods for the SchemaService API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Schema resource string. + # + # @overload schema_path(project:, location:, data_store:, schema:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param schema [String] + # + # @overload schema_path(project:, location:, collection:, data_store:, schema:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param schema [String] + # + # @return [::String] + def schema_path **args + resources = { + "data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/schemas/#{schema}" + end), + "collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/schemas/#{schema}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb new file mode 100644 index 000000000000..edb5a4dd991b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/schema_service/credentials" +require "google/cloud/discovery_engine/v1/schema_service/paths" +require "google/cloud/discovery_engine/v1/schema_service/rest/operations" +require "google/cloud/discovery_engine/v1/schema_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/schema_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + module SchemaService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/schema_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb new file mode 100644 index 000000000000..e09d0434425e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb @@ -0,0 +1,867 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/schema_service_pb" +require "google/cloud/discovery_engine/v1/schema_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + module Rest + ## + # REST client for the SchemaService service. + # + # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :schema_service_stub + + ## + # Configure the SchemaService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SchemaService clients + # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SchemaService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @schema_service_stub.universe_domain + end + + ## + # Create a new SchemaService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SchemaService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @schema_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @schema_service_stub.endpoint + config.universe_domain = @schema_service_stub.universe_domain + config.logger = @schema_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @schema_service_stub.logger + end + + # Service calls + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload get_schema(request, options = nil) + # Pass arguments to `get_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_schema(name: nil) + # Pass arguments to `get_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Schema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new + # + # # Call the get_schema method. + # result = client.get_schema request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. + # p result + # + def get_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.get_schema request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # + # @overload list_schemas(request, options = nil) + # Pass arguments to `list_schemas` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_schemas(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_schemas` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @param page_size [::Integer] + # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to + # return. The service may return fewer than this value. + # + # If unspecified, at most 100 + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. + # + # The maximum value is 1000; values above 1000 are set to 1000. + # @param page_token [::String] + # A page token, received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas} + # must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new + # + # # Call the list_schemas method. + # result = client.list_schemas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. + # p item + # end + # + def list_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_schemas.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.list_schemas request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @schema_service_stub, :list_schemas, "schemas", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload create_schema(request, options = nil) + # Pass arguments to `create_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_schema(parent: nil, schema: nil, schema_id: nil) + # Pass arguments to `create_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. + # @param schema_id [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final + # component of the + # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. + # + # This field should conform to + # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + # limit of 63 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new + # + # # Call the create_schema method. + # result = client.create_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.create_schema request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload update_schema(request, options = nil) + # Pass arguments to `update_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_schema(schema: nil, allow_missing: nil) + # Pass arguments to `update_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. + # @param allow_missing [::Boolean] + # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # created. In this situation, `update_mask` is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new + # + # # Call the update_schema method. + # result = client.update_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.update_schema request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. + # + # @overload delete_schema(request, options = nil) + # Pass arguments to `delete_schema` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_schema(name: nil) + # Pass arguments to `delete_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new + # + # # Call the delete_schema method. + # result = client.delete_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_schema.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @schema_service_stub.delete_schema request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SchemaService REST API. + # + # This class represents the configuration for SchemaService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_schema to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_schema.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_schema.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SchemaService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_schema + ## + # RPC-specific configuration for `list_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_schemas + ## + # RPC-specific configuration for `create_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_schema + ## + # RPC-specific configuration for `update_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_schema + ## + # RPC-specific configuration for `delete_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_schema + + # @private + def initialize parent_rpcs = nil + get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema + @get_schema = ::Gapic::Config::Method.new get_schema_config + list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas + @list_schemas = ::Gapic::Config::Method.new list_schemas_config + create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema + @create_schema = ::Gapic::Config::Method.new create_schema_config + update_schema_config = parent_rpcs.update_schema if parent_rpcs.respond_to? :update_schema + @update_schema = ::Gapic::Config::Method.new update_schema_config + delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema + @delete_schema = ::Gapic::Config::Method.new delete_schema_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb new file mode 100644 index 000000000000..e3eb1058a4ad --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SchemaService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SchemaService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb new file mode 100644 index 000000000000..4cca0f5c7fd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb @@ -0,0 +1,425 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/schema_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SchemaService + module Rest + ## + # REST service stub for the SchemaService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Schema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # A result object deserialized from the server's reply + def get_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Schema.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_schemas REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse] + # A result object deserialized from the server's reply + def list_schemas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_schemas_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_schemas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_schema_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_schemas REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_schemas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/schemas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/schemas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/schemas", + body: "schema", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/schemas", + body: "schema", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{schema.name}", + body: "schema", + matches: [ + ["schema.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{schema.name}", + body: "schema", + matches: [ + ["schema.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_schema REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb new file mode 100644 index 000000000000..aaac77819f3f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/search_service/credentials" +require "google/cloud/discovery_engine/v1/search_service/paths" +require "google/cloud/discovery_engine/v1/search_service/client" +require "google/cloud/discovery_engine/v1/search_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for search. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/search_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/search_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + module SearchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "search_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb new file mode 100644 index 000000000000..774cafd0012c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb @@ -0,0 +1,1315 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/search_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + ## + # Client for the SearchService service. + # + # Service for search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_service_stub + + ## + # Configure the SearchService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchService clients + # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @search_service_stub.universe_domain + end + + ## + # Create a new SearchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/search_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @search_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::SearchService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @search_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + config.logger = @search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_service_stub.logger + end + + # Service calls + + ## + # Performs a search. + # + # @overload search(request, options = nil) + # Pass arguments to `search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) + # Pass arguments to `search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `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. + # @param branch [::String] + # 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. + # @param query [::String] + # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` + # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] + # Raw image query. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. The maximum allowed value depends on the data type. Values above + # the maximum value are coerced to the maximum value. + # + # * Websites with basic indexing: Default `10`, Maximum `25`. + # * Websites with advanced indexing: Default `25`, Maximum `50`. + # * Other: Default `50`, Maximum `100`. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as + # relevant) in search results. This field is only considered if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is + # unset. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. + # @param one_box_page_size [::Integer] + # The maximum number of results to return for OneBox. + # This applies to each OneBox type individually. + # Default number is 10. + # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] + # Specifications that define the specific + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, + # along with configurations for those data stores. This is only considered + # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data + # stores. For engines with a single data store, the specs directly under + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be + # used. + # @param filter [::String] + # 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which documents are returned. Documents can be ordered by + # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. + # Leave it unset if ordered by relevance. `order_by` expression is + # case-sensitive. + # + # For more information on ordering the website search results, see + # [Order web search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). + # For more information on ordering the healthcare search results, see + # [Order healthcare search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] + # Information about the end user. + # Highly recommended for analytics and personalization. + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} + # is used to deduce `device_type` for analytics. + # @param language_code [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see [Standard + # fields](https://cloud.google.com/apis/design/standard_fields). This field + # helps to better interpret the query. If a value isn't specified, the query + # language code is automatically detected, which may not be accurate. + # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] + # 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. + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # 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. + # For example, `user_country_code: "au"` + # + # For available codes see [Country + # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) + # + # * `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. + # For example, `search_type: 1` + # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. + # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction takes effect. + # @param user_pseudo_id [::String] + # Optional. 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. + # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] + # A specification for configuring the behavior of content search. + # @param ranking_expression [::String] + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. + # The syntax and supported features depend on the + # `ranking_expression_backend` value. If `ranking_expression_backend` is not + # provided, it defaults to `RANK_BY_EMBEDDING`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single + # function or multiple functions that are joined 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)`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is set to `RANK_BY_FORMULA`, the following expression types (and + # combinations of those chained using + or + # * operators) are supported: + # + # * `double` + # * `signal` + # * `log(signal)` + # * `exp(signal)` + # * `rr(signal, double > 0)` -- reciprocal rank transformation with second + # argument being a denominator constant. + # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. + # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns + # signal2 | double, else returns signal1. + # + # Here are a few examples of ranking formulas that use the supported + # ranking expression types: + # + # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` + # -- mostly rank by the logarithm of `keyword_similarity_score` with slight + # `semantic_smilarity_score` adjustment. + # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * + # is_nan(keyword_similarity_score)` -- rank by the exponent of + # `semantic_similarity_score` filling the value with 0 if it's NaN, also + # add constant 0.3 adjustment to the final score if + # `semantic_similarity_score` is NaN. + # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * + # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank + # of `keyword_similarity_score` with slight adjustment of reciprocal rank + # of `semantic_smilarity_score`. + # + # The following signals are supported: + # + # * `semantic_similarity_score`: semantic similarity adjustment that is + # calculated using the embeddings generated by a proprietary Google model. + # This score determines how semantically similar a search query is to a + # document. + # * `keyword_similarity_score`: keyword match adjustment uses the Best + # Match 25 (BM25) ranking function. This score is calculated using a + # probabilistic model to estimate the probability that a document is + # relevant to a given query. + # * `relevance_score`: semantic relevance adjustment that uses a + # proprietary Google model to determine the meaning and intent behind a + # user's query in context with the content in the documents. + # * `pctr_rank`: predicted conversion rate adjustment as a rank use + # predicted Click-through rate (pCTR) to gauge the relevance and + # attractiveness of a search result from a user's perspective. A higher + # pCTR suggests that the result is more likely to satisfy the user's query + # and intent, making it a valuable signal for ranking. + # * `freshness_rank`: freshness adjustment as a rank + # * `document_age`: The time in hours elapsed since the document was last + # updated, a floating-point number (e.g., 0.25 means 15 minutes). + # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary + # Google model to determine the keyword-based overlap between the query and + # the document. + # * `base_rank`: the default rank of the result + # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + # p item + # end + # + def search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.call_rpc :search, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @search_service_stub, :search, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs a search. Similar to the + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # method, but a lite version that allows API key for authentication, where + # OAuth and IAM checks are not required. + # + # Only public website search is supported by this method. If data stores and + # engines not associated with public website search are specified, a + # `FAILED_PRECONDITION` error is returned. + # + # This method can be used for easy onboarding without having to implement an + # authentication backend. However, it is strongly recommended to use + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # instead with required OAuth and IAM checks to provide better data security. + # + # @overload search_lite(request, options = nil) + # Pass arguments to `search_lite` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) + # Pass arguments to `search_lite` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `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. + # @param branch [::String] + # 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. + # @param query [::String] + # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` + # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] + # Raw image query. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. The maximum allowed value depends on the data type. Values above + # the maximum value are coerced to the maximum value. + # + # * Websites with basic indexing: Default `10`, Maximum `25`. + # * Websites with advanced indexing: Default `25`, Maximum `50`. + # * Other: Default `50`, Maximum `100`. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as + # relevant) in search results. This field is only considered if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is + # unset. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. + # @param one_box_page_size [::Integer] + # The maximum number of results to return for OneBox. + # This applies to each OneBox type individually. + # Default number is 10. + # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] + # Specifications that define the specific + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, + # along with configurations for those data stores. This is only considered + # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data + # stores. For engines with a single data store, the specs directly under + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be + # used. + # @param filter [::String] + # 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which documents are returned. Documents can be ordered by + # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. + # Leave it unset if ordered by relevance. `order_by` expression is + # case-sensitive. + # + # For more information on ordering the website search results, see + # [Order web search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). + # For more information on ordering the healthcare search results, see + # [Order healthcare search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] + # Information about the end user. + # Highly recommended for analytics and personalization. + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} + # is used to deduce `device_type` for analytics. + # @param language_code [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see [Standard + # fields](https://cloud.google.com/apis/design/standard_fields). This field + # helps to better interpret the query. If a value isn't specified, the query + # language code is automatically detected, which may not be accurate. + # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] + # 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. + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # 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. + # For example, `user_country_code: "au"` + # + # For available codes see [Country + # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) + # + # * `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. + # For example, `search_type: 1` + # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. + # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction takes effect. + # @param user_pseudo_id [::String] + # Optional. 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. + # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] + # A specification for configuring the behavior of content search. + # @param ranking_expression [::String] + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. + # The syntax and supported features depend on the + # `ranking_expression_backend` value. If `ranking_expression_backend` is not + # provided, it defaults to `RANK_BY_EMBEDDING`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single + # function or multiple functions that are joined 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)`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is set to `RANK_BY_FORMULA`, the following expression types (and + # combinations of those chained using + or + # * operators) are supported: + # + # * `double` + # * `signal` + # * `log(signal)` + # * `exp(signal)` + # * `rr(signal, double > 0)` -- reciprocal rank transformation with second + # argument being a denominator constant. + # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. + # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns + # signal2 | double, else returns signal1. + # + # Here are a few examples of ranking formulas that use the supported + # ranking expression types: + # + # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` + # -- mostly rank by the logarithm of `keyword_similarity_score` with slight + # `semantic_smilarity_score` adjustment. + # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * + # is_nan(keyword_similarity_score)` -- rank by the exponent of + # `semantic_similarity_score` filling the value with 0 if it's NaN, also + # add constant 0.3 adjustment to the final score if + # `semantic_similarity_score` is NaN. + # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * + # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank + # of `keyword_similarity_score` with slight adjustment of reciprocal rank + # of `semantic_smilarity_score`. + # + # The following signals are supported: + # + # * `semantic_similarity_score`: semantic similarity adjustment that is + # calculated using the embeddings generated by a proprietary Google model. + # This score determines how semantically similar a search query is to a + # document. + # * `keyword_similarity_score`: keyword match adjustment uses the Best + # Match 25 (BM25) ranking function. This score is calculated using a + # probabilistic model to estimate the probability that a document is + # relevant to a given query. + # * `relevance_score`: semantic relevance adjustment that uses a + # proprietary Google model to determine the meaning and intent behind a + # user's query in context with the content in the documents. + # * `pctr_rank`: predicted conversion rate adjustment as a rank use + # predicted Click-through rate (pCTR) to gauge the relevance and + # attractiveness of a search result from a user's perspective. A higher + # pCTR suggests that the result is more likely to satisfy the user's query + # and intent, making it a valuable signal for ranking. + # * `freshness_rank`: freshness adjustment as a rank + # * `document_age`: The time in hours elapsed since the document was last + # updated, a floating-point number (e.g., 0.25 means 15 minutes). + # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary + # Google model to determine the keyword-based overlap between the query and + # the document. + # * `base_rank`: the default rank of the result + # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + # + # # Call the search_lite method. + # result = client.search_lite request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + # p item + # end + # + def search_lite request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_lite.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config + header_params["serving_config"] = request.serving_config + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.search_lite.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_lite.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.call_rpc :search_lite, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @search_service_stub, :search_lite, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SearchService API. + # + # This class represents the configuration for SearchService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SearchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `search` + # @return [::Gapic::Config::Method] + # + attr_reader :search + ## + # RPC-specific configuration for `search_lite` + # @return [::Gapic::Config::Method] + # + attr_reader :search_lite + + # @private + def initialize parent_rpcs = nil + search_config = parent_rpcs.search if parent_rpcs.respond_to? :search + @search = ::Gapic::Config::Method.new search_config + search_lite_config = parent_rpcs.search_lite if parent_rpcs.respond_to? :search_lite + @search_lite = ::Gapic::Config::Method.new search_lite_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb new file mode 100644 index 000000000000..50b917e729ce --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + # Credentials for the SearchService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb new file mode 100644 index 000000000000..e3827042aa03 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + # Path helper methods for the SearchService API. + module Paths + ## + # Create a fully-qualified Branch resource string. + # + # @overload branch_path(project:, location:, data_store:, branch:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # + # @overload branch_path(project:, location:, collection:, data_store:, branch:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # + # @return [::String] + def branch_path **args + resources = { + "branch:data_store:location:project" => (proc do |project:, location:, data_store:, branch:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}" + end), + "branch:collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, branch:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified ServingConfig resource string. + # + # @overload serving_config_path(project:, location:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path **args + resources = { + "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, engine:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb new file mode 100644 index 000000000000..c3a52f5574f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/search_service/credentials" +require "google/cloud/discovery_engine/v1/search_service/paths" +require "google/cloud/discovery_engine/v1/search_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for search. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/search_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + module SearchService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb new file mode 100644 index 000000000000..fcf1e19913e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb @@ -0,0 +1,1258 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/search_service_pb" +require "google/cloud/discovery_engine/v1/search_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + module Rest + ## + # REST client for the SearchService service. + # + # Service for search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_service_stub + + ## + # Configure the SearchService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchService clients + # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @search_service_stub.universe_domain + end + + ## + # Create a new SearchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @search_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_service_stub.endpoint + config.universe_domain = @search_service_stub.universe_domain + config.logger = @search_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_service_stub.logger + end + + # Service calls + + ## + # Performs a search. + # + # @overload search(request, options = nil) + # Pass arguments to `search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) + # Pass arguments to `search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `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. + # @param branch [::String] + # 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. + # @param query [::String] + # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` + # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] + # Raw image query. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. The maximum allowed value depends on the data type. Values above + # the maximum value are coerced to the maximum value. + # + # * Websites with basic indexing: Default `10`, Maximum `25`. + # * Websites with advanced indexing: Default `25`, Maximum `50`. + # * Other: Default `50`, Maximum `100`. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as + # relevant) in search results. This field is only considered if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is + # unset. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. + # @param one_box_page_size [::Integer] + # The maximum number of results to return for OneBox. + # This applies to each OneBox type individually. + # Default number is 10. + # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] + # Specifications that define the specific + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, + # along with configurations for those data stores. This is only considered + # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data + # stores. For engines with a single data store, the specs directly under + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be + # used. + # @param filter [::String] + # 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which documents are returned. Documents can be ordered by + # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. + # Leave it unset if ordered by relevance. `order_by` expression is + # case-sensitive. + # + # For more information on ordering the website search results, see + # [Order web search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). + # For more information on ordering the healthcare search results, see + # [Order healthcare search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] + # Information about the end user. + # Highly recommended for analytics and personalization. + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} + # is used to deduce `device_type` for analytics. + # @param language_code [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see [Standard + # fields](https://cloud.google.com/apis/design/standard_fields). This field + # helps to better interpret the query. If a value isn't specified, the query + # language code is automatically detected, which may not be accurate. + # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] + # 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. + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # 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. + # For example, `user_country_code: "au"` + # + # For available codes see [Country + # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) + # + # * `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. + # For example, `search_type: 1` + # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. + # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction takes effect. + # @param user_pseudo_id [::String] + # Optional. 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. + # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] + # A specification for configuring the behavior of content search. + # @param ranking_expression [::String] + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. + # The syntax and supported features depend on the + # `ranking_expression_backend` value. If `ranking_expression_backend` is not + # provided, it defaults to `RANK_BY_EMBEDDING`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single + # function or multiple functions that are joined 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)`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is set to `RANK_BY_FORMULA`, the following expression types (and + # combinations of those chained using + or + # * operators) are supported: + # + # * `double` + # * `signal` + # * `log(signal)` + # * `exp(signal)` + # * `rr(signal, double > 0)` -- reciprocal rank transformation with second + # argument being a denominator constant. + # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. + # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns + # signal2 | double, else returns signal1. + # + # Here are a few examples of ranking formulas that use the supported + # ranking expression types: + # + # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` + # -- mostly rank by the logarithm of `keyword_similarity_score` with slight + # `semantic_smilarity_score` adjustment. + # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * + # is_nan(keyword_similarity_score)` -- rank by the exponent of + # `semantic_similarity_score` filling the value with 0 if it's NaN, also + # add constant 0.3 adjustment to the final score if + # `semantic_similarity_score` is NaN. + # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * + # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank + # of `keyword_similarity_score` with slight adjustment of reciprocal rank + # of `semantic_smilarity_score`. + # + # The following signals are supported: + # + # * `semantic_similarity_score`: semantic similarity adjustment that is + # calculated using the embeddings generated by a proprietary Google model. + # This score determines how semantically similar a search query is to a + # document. + # * `keyword_similarity_score`: keyword match adjustment uses the Best + # Match 25 (BM25) ranking function. This score is calculated using a + # probabilistic model to estimate the probability that a document is + # relevant to a given query. + # * `relevance_score`: semantic relevance adjustment that uses a + # proprietary Google model to determine the meaning and intent behind a + # user's query in context with the content in the documents. + # * `pctr_rank`: predicted conversion rate adjustment as a rank use + # predicted Click-through rate (pCTR) to gauge the relevance and + # attractiveness of a search result from a user's perspective. A higher + # pCTR suggests that the result is more likely to satisfy the user's query + # and intent, making it a valuable signal for ranking. + # * `freshness_rank`: freshness adjustment as a rank + # * `document_age`: The time in hours elapsed since the document was last + # updated, a floating-point number (e.g., 0.25 means 15 minutes). + # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary + # Google model to determine the keyword-based overlap between the query and + # the document. + # * `base_rank`: the default rank of the result + # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + # p item + # end + # + def search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.search request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search, "results", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs a search. Similar to the + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # method, but a lite version that allows API key for authentication, where + # OAuth and IAM checks are not required. + # + # Only public website search is supported by this method. If data stores and + # engines not associated with public website search are specified, a + # `FAILED_PRECONDITION` error is returned. + # + # This method can be used for easy onboarding without having to implement an + # authentication backend. However, it is strongly recommended to use + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # instead with required OAuth and IAM checks to provide better data security. + # + # @overload search_lite(request, options = nil) + # Pass arguments to `search_lite` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) + # Pass arguments to `search_lite` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `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. + # @param branch [::String] + # 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. + # @param query [::String] + # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` + # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] + # Raw image query. + # @param page_size [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. The maximum allowed value depends on the data type. Values above + # the maximum value are coerced to the maximum value. + # + # * Websites with basic indexing: Default `10`, Maximum `25`. + # * Websites with advanced indexing: Default `25`, Maximum `50`. + # * Other: Default `50`, Maximum `100`. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @param page_token [::String] + # A page token received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @param offset [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as + # relevant) in search results. This field is only considered if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is + # unset. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. + # @param one_box_page_size [::Integer] + # The maximum number of results to return for OneBox. + # This applies to each OneBox type individually. + # Default number is 10. + # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] + # Specifications that define the specific + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, + # along with configurations for those data stores. This is only considered + # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data + # stores. For engines with a single data store, the specs directly under + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be + # used. + # @param filter [::String] + # 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @param canonical_filter [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @param order_by [::String] + # The order in which documents are returned. Documents can be ordered by + # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. + # Leave it unset if ordered by relevance. `order_by` expression is + # case-sensitive. + # + # For more information on ordering the website search results, see + # [Order web search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). + # For more information on ordering the healthcare search results, see + # [Order healthcare search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] + # Information about the end user. + # Highly recommended for analytics and personalization. + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} + # is used to deduce `device_type` for analytics. + # @param language_code [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see [Standard + # fields](https://cloud.google.com/apis/design/standard_fields). This field + # helps to better interpret the query. If a value isn't specified, the query + # language code is automatically detected, which may not be accurate. + # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] + # 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. + # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] + # Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] + # 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. + # For example, `user_country_code: "au"` + # + # For available codes see [Country + # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) + # + # * `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. + # For example, `search_type: 1` + # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. + # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] + # The spell correction specification that specifies the mode under + # which spell correction takes effect. + # @param user_pseudo_id [::String] + # Optional. 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. + # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] + # A specification for configuring the behavior of content search. + # @param ranking_expression [::String] + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. + # The syntax and supported features depend on the + # `ranking_expression_backend` value. If `ranking_expression_backend` is not + # provided, it defaults to `RANK_BY_EMBEDDING`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single + # function or multiple functions that are joined 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)`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is set to `RANK_BY_FORMULA`, the following expression types (and + # combinations of those chained using + or + # * operators) are supported: + # + # * `double` + # * `signal` + # * `log(signal)` + # * `exp(signal)` + # * `rr(signal, double > 0)` -- reciprocal rank transformation with second + # argument being a denominator constant. + # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. + # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns + # signal2 | double, else returns signal1. + # + # Here are a few examples of ranking formulas that use the supported + # ranking expression types: + # + # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` + # -- mostly rank by the logarithm of `keyword_similarity_score` with slight + # `semantic_smilarity_score` adjustment. + # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * + # is_nan(keyword_similarity_score)` -- rank by the exponent of + # `semantic_similarity_score` filling the value with 0 if it's NaN, also + # add constant 0.3 adjustment to the final score if + # `semantic_similarity_score` is NaN. + # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * + # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank + # of `keyword_similarity_score` with slight adjustment of reciprocal rank + # of `semantic_smilarity_score`. + # + # The following signals are supported: + # + # * `semantic_similarity_score`: semantic similarity adjustment that is + # calculated using the embeddings generated by a proprietary Google model. + # This score determines how semantically similar a search query is to a + # document. + # * `keyword_similarity_score`: keyword match adjustment uses the Best + # Match 25 (BM25) ranking function. This score is calculated using a + # probabilistic model to estimate the probability that a document is + # relevant to a given query. + # * `relevance_score`: semantic relevance adjustment that uses a + # proprietary Google model to determine the meaning and intent behind a + # user's query in context with the content in the documents. + # * `pctr_rank`: predicted conversion rate adjustment as a rank use + # predicted Click-through rate (pCTR) to gauge the relevance and + # attractiveness of a search result from a user's perspective. A higher + # pCTR suggests that the result is more likely to satisfy the user's query + # and intent, making it a valuable signal for ranking. + # * `freshness_rank`: freshness adjustment as a rank + # * `document_age`: The time in hours elapsed since the document was last + # updated, a floating-point number (e.g., 0.25 means 15 minutes). + # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary + # Google model to determine the keyword-based overlap between the query and + # the document. + # * `base_rank`: the default rank of the result + # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + # + # # Call the search_lite method. + # result = client.search_lite request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + # p item + # end + # + def search_lite request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.search_lite.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_lite.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_lite.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_service_stub.search_lite request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search_lite, "results", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SearchService REST API. + # + # This class represents the configuration for SearchService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # search to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.search.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SearchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `search` + # @return [::Gapic::Config::Method] + # + attr_reader :search + ## + # RPC-specific configuration for `search_lite` + # @return [::Gapic::Config::Method] + # + attr_reader :search_lite + + # @private + def initialize parent_rpcs = nil + search_config = parent_rpcs.search if parent_rpcs.respond_to? :search + @search = ::Gapic::Config::Method.new search_config + search_lite_config = parent_rpcs.search_lite if parent_rpcs.respond_to? :search_lite + @search_lite = ::Gapic::Config::Method.new search_lite_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb new file mode 100644 index 000000000000..eed90b551bda --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb @@ -0,0 +1,237 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/search_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + module Rest + ## + # REST service stub for the SearchService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] + # A result object deserialized from the server's reply + def search request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_lite REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] + # A result object deserialized from the server's reply + def search_lite request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_lite_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "search_lite", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:search", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:search", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:search", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_lite REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_lite_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:searchLite", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:searchLite", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{serving_config}:searchLite", + body: "*", + matches: [ + ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb new file mode 100644 index 000000000000..613e532121c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/search_tuning_service/credentials" +require "google/cloud/discovery_engine/v1/search_tuning_service/paths" +require "google/cloud/discovery_engine/v1/search_tuning_service/operations" +require "google/cloud/discovery_engine/v1/search_tuning_service/client" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for search tuning. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/search_tuning_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/search_tuning_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new + # + module SearchTuningService + end + end + end + end +end + +helper_path = ::File.join __dir__, "search_tuning_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/search_tuning_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb new file mode 100644 index 000000000000..ae0e87539eac --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb @@ -0,0 +1,621 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + ## + # Client for the SearchTuningService service. + # + # Service for search tuning. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_tuning_service_stub + + ## + # Configure the SearchTuningService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchTuningService clients + # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchTuningService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @search_tuning_service_stub.universe_domain + end + + ## + # Create a new SearchTuningService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchTuningService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/search_tuning_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @search_tuning_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @search_tuning_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_tuning_service_stub.endpoint + config.universe_domain = @search_tuning_service_stub.universe_domain + config.logger = @search_tuning_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_tuning_service_stub.logger + end + + # Service calls + + ## + # Trains a custom model. + # + # @overload train_custom_model(request, options = nil) + # Pass arguments to `train_custom_model` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) + # Pass arguments to `train_custom_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_training_input [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput, ::Hash] + # Cloud Storage training input. + # @param data_store [::String] + # Required. The resource name of the Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to train the models. + # @param model_type [::String] + # Model to be trained. Supported values are: + # + # * **search-tuning**: Fine tuning the search system based on data provided. + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the data ingestion and + # training. + # @param model_id [::String] + # If not provided, a UUID will be generated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new + # + # # Call the train_custom_model method. + # result = client.train_custom_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def train_custom_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.train_custom_model.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.data_store + header_params["data_store"] = request.data_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_custom_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_tuning_service_stub.call_rpc :train_custom_model, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of all the custom models. + # + # @overload list_custom_models(request, options = nil) + # Pass arguments to `list_custom_models` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_custom_models(data_store: nil) + # Pass arguments to `list_custom_models` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::String] + # Required. The resource name of the parent Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to fetch the models + # from. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new + # + # # Call the list_custom_models method. + # result = client.list_custom_models request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. + # p result + # + def list_custom_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_custom_models.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.data_store + header_params["data_store"] = request.data_store + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_tuning_service_stub.call_rpc :list_custom_models, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SearchTuningService API. + # + # This class represents the configuration for SearchTuningService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # train_custom_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.train_custom_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.train_custom_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SearchTuningService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `train_custom_model` + # @return [::Gapic::Config::Method] + # + attr_reader :train_custom_model + ## + # RPC-specific configuration for `list_custom_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_models + + # @private + def initialize parent_rpcs = nil + train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model + @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config + list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models + @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb new file mode 100644 index 000000000000..249bc36141d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + # Credentials for the SearchTuningService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb new file mode 100644 index 000000000000..eb41e7486946 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SearchTuningService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchTuningService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb new file mode 100644 index 000000000000..36e74c2d4ed3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + # Path helper methods for the SearchTuningService API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb new file mode 100644 index 000000000000..5d4464762e5f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/search_tuning_service/credentials" +require "google/cloud/discovery_engine/v1/search_tuning_service/paths" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest/operations" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for search tuning. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/search_tuning_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new + # + module SearchTuningService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb new file mode 100644 index 000000000000..1470edaef33c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb @@ -0,0 +1,564 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + module Rest + ## + # REST client for the SearchTuningService service. + # + # Service for search tuning. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :search_tuning_service_stub + + ## + # Configure the SearchTuningService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SearchTuningService clients + # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchTuningService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @search_tuning_service_stub.universe_domain + end + + ## + # Create a new SearchTuningService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SearchTuningService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @search_tuning_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @search_tuning_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @search_tuning_service_stub.endpoint + config.universe_domain = @search_tuning_service_stub.universe_domain + config.logger = @search_tuning_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @search_tuning_service_stub.logger + end + + # Service calls + + ## + # Trains a custom model. + # + # @overload train_custom_model(request, options = nil) + # Pass arguments to `train_custom_model` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) + # Pass arguments to `train_custom_model` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_training_input [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput, ::Hash] + # Cloud Storage training input. + # @param data_store [::String] + # Required. The resource name of the Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to train the models. + # @param model_type [::String] + # Model to be trained. Supported values are: + # + # * **search-tuning**: Fine tuning the search system based on data provided. + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the data ingestion and + # training. + # @param model_id [::String] + # If not provided, a UUID will be generated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new + # + # # Call the train_custom_model method. + # result = client.train_custom_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def train_custom_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.train_custom_model.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.train_custom_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_tuning_service_stub.train_custom_model request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of all the custom models. + # + # @overload list_custom_models(request, options = nil) + # Pass arguments to `list_custom_models` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_custom_models(data_store: nil) + # Pass arguments to `list_custom_models` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_store [::String] + # Required. The resource name of the parent Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to fetch the models + # from. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new + # + # # Call the list_custom_models method. + # result = client.list_custom_models request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. + # p result + # + def list_custom_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_custom_models.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @search_tuning_service_stub.list_custom_models request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SearchTuningService REST API. + # + # This class represents the configuration for SearchTuningService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # train_custom_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.train_custom_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.train_custom_model.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SearchTuningService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `train_custom_model` + # @return [::Gapic::Config::Method] + # + attr_reader :train_custom_model + ## + # RPC-specific configuration for `list_custom_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_models + + # @private + def initialize parent_rpcs = nil + train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model + @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config + list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models + @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb new file mode 100644 index 000000000000..738b662cbeae --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SearchTuningService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SearchTuningService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb new file mode 100644 index 000000000000..732a08aab3cb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + module Rest + ## + # REST service stub for the SearchTuningService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the train_custom_model REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def train_custom_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_train_custom_model_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "train_custom_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_custom_models REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] + # A result object deserialized from the server's reply + def list_custom_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_models_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_custom_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the train_custom_model REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_train_custom_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{data_store}:trainCustomModel", + body: "*", + matches: [ + ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_models REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_custom_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{data_store}/customModels", + matches: [ + ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb new file mode 100644 index 000000000000..29c8d59857e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/serving_config_service/credentials" +require "google/cloud/discovery_engine/v1/serving_config_service/paths" +require "google/cloud/discovery_engine/v1/serving_config_service/client" +require "google/cloud/discovery_engine/v1/serving_config_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for operations related to + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/serving_config_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/serving_config_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new + # + module ServingConfigService + end + end + end + end +end + +helper_path = ::File.join __dir__, "serving_config_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/serving_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb new file mode 100644 index 000000000000..c1aa34c248ac --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb @@ -0,0 +1,501 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/serving_config_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ServingConfigService + ## + # Client for the ServingConfigService service. + # + # Service for operations related to + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :serving_config_service_stub + + ## + # Configure the ServingConfigService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServingConfigService clients + # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServingConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @serving_config_service_stub.universe_domain + end + + ## + # Create a new ServingConfigService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServingConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/serving_config_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @serving_config_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @serving_config_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @serving_config_service_stub.logger + end + + # Service calls + + ## + # Updates a ServingConfig. + # + # Returns a NOT_FOUND error if the ServingConfig does not exist. + # + # @overload update_serving_config(request, options = nil) + # Pass arguments to `update_serving_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_serving_config(serving_config: nil, update_mask: nil) + # Pass arguments to `update_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::Google::Cloud::DiscoveryEngine::V1::ServingConfig, ::Hash] + # Required. The ServingConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. + # The following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new + # + # # Call the update_serving_config method. + # result = client.update_serving_config request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. + # p result + # + def update_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.serving_config&.name + header_params["serving_config.name"] = request.serving_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ServingConfigService API. + # + # This class represents the configuration for ServingConfigService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_serving_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_serving_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_serving_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ServingConfigService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_serving_config + + # @private + def initialize parent_rpcs = nil + update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config + @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb new file mode 100644 index 000000000000..51723767eb9d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ServingConfigService + # Credentials for the ServingConfigService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb new file mode 100644 index 000000000000..421d34a5509f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ServingConfigService + # Path helper methods for the ServingConfigService API. + module Paths + ## + # Create a fully-qualified ServingConfig resource string. + # + # @overload serving_config_path(project:, location:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param serving_config [String] + # + # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param serving_config [String] + # + # @return [::String] + def serving_config_path **args + resources = { + "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" + end), + "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb new file mode 100644 index 000000000000..ec6523375801 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/serving_config_service/credentials" +require "google/cloud/discovery_engine/v1/serving_config_service/paths" +require "google/cloud/discovery_engine/v1/serving_config_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for operations related to + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/serving_config_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new + # + module ServingConfigService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/serving_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb new file mode 100644 index 000000000000..7cae7ef5eb03 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb @@ -0,0 +1,451 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/serving_config_service_pb" +require "google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ServingConfigService + module Rest + ## + # REST client for the ServingConfigService service. + # + # Service for operations related to + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :serving_config_service_stub + + ## + # Configure the ServingConfigService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ServingConfigService clients + # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ServingConfigService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @serving_config_service_stub.universe_domain + end + + ## + # Create a new ServingConfigService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ServingConfigService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @serving_config_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @serving_config_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @serving_config_service_stub.endpoint + config.universe_domain = @serving_config_service_stub.universe_domain + config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @serving_config_service_stub.logger + end + + # Service calls + + ## + # Updates a ServingConfig. + # + # Returns a NOT_FOUND error if the ServingConfig does not exist. + # + # @overload update_serving_config(request, options = nil) + # Pass arguments to `update_serving_config` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_serving_config(serving_config: nil, update_mask: nil) + # Pass arguments to `update_serving_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param serving_config [::Google::Cloud::DiscoveryEngine::V1::ServingConfig, ::Hash] + # Required. The ServingConfig to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. + # The following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new + # + # # Call the update_serving_config method. + # result = client.update_serving_config request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. + # p result + # + def update_serving_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_serving_config.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_serving_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @serving_config_service_stub.update_serving_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ServingConfigService REST API. + # + # This class represents the configuration for ServingConfigService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # update_serving_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.update_serving_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.update_serving_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ServingConfigService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `update_serving_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_serving_config + + # @private + def initialize parent_rpcs = nil + update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config + @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb new file mode 100644 index 000000000000..f05240911288 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/serving_config_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ServingConfigService + module Rest + ## + # REST service stub for the ServingConfigService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the update_serving_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # A result object deserialized from the server's reply + def update_serving_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_serving_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_serving_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the update_serving_config REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_serving_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{serving_config.name}", + body: "serving_config", + matches: [ + ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{serving_config.name}", + body: "serving_config", + matches: [ + ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{serving_config.name}", + body: "serving_config", + matches: [ + ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb new file mode 100644 index 000000000000..b58f2537bba9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/session_service/credentials" +require "google/cloud/discovery_engine/v1/session_service/paths" +require "google/cloud/discovery_engine/v1/session_service/client" +require "google/cloud/discovery_engine/v1/session_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Sessions and Session-related resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/session_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/session_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + module SessionService + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/session_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb new file mode 100644 index 000000000000..78a237f2e1d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb @@ -0,0 +1,937 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/session_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + ## + # Client for the SessionService service. + # + # Service for managing Sessions and Session-related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_service_stub + + ## + # Configure the SessionService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionService clients + # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_service_stub.universe_domain + end + + ## + # Create a new SessionService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/session_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @session_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @session_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.logger = @session_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @session_service_stub.logger + end + + # Service calls + + ## + # Creates a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session(parent: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The session to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :create_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :delete_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Session. + # + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The Session to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} + # + # If not set or empty, all supported fields are updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session&.name + header_params["session.name"] = request.session.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :update_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session(name: nil, include_answer_details: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @param include_answer_details [::Boolean] + # Optional. If set to true, the full session including all answer details + # will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :get_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Sessions by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSessions` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A comma-separated list of fields to filter by, in EBNF grammar. + # The supported fields are: + # * `user_pseudo_id` + # * `state` + # * `display_name` + # * `starred` + # * `is_pinned` + # * `labels` + # * `create_time` + # * `update_time` + # + # Examples: + # "user_pseudo_id = some_id" + # "display_name = \"some_name\"" + # "starred = true" + # "is_pinned=true AND (NOT labels:hidden)" + # "create_time > \"1970-01-01T12:00:00Z\"" + # @param order_by [::String] + # 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` + # * `session_name` + # * `is_pinned` + # + # Example: + # + # * "update_time desc" + # * "create_time" + # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then + # by update_time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_service_stub, :list_sessions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionService API. + # + # This class represents the configuration for SessionService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SessionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb new file mode 100644 index 000000000000..7ca5eca51bc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + # Credentials for the SessionService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb new file mode 100644 index 000000000000..ebbab8b29f88 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb @@ -0,0 +1,355 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + # Path helper methods for the SessionService API. + module Paths + ## + # Create a fully-qualified Answer resource string. + # + # @overload answer_path(project:, location:, data_store:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # @param answer [String] + # + # @overload answer_path(project:, location:, collection:, data_store:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # @param answer [String] + # + # @overload answer_path(project:, location:, collection:, engine:, session:, answer:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # @param answer [String] + # + # @return [::String] + def answer_path **args + resources = { + "answer:data_store:location:project:session" => (proc do |project:, location:, data_store:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" + end), + "answer:collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" + end), + "answer:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:, answer:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/answers/#{answer}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified AssistAnswer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # @param assist_answer [String] + # + # @return [::String] + def assist_answer_path project:, location:, collection:, engine:, session:, assist_answer: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/assistAnswers/#{assist_answer}" + end + + ## + # Create a fully-qualified Chunk resource string. + # + # @overload chunk_path(project:, location:, data_store:, branch:, document:, chunk:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # @param chunk [String] + # + # @overload chunk_path(project:, location:, collection:, data_store:, branch:, document:, chunk:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # @param chunk [String] + # + # @return [::String] + def chunk_path **args + resources = { + "branch:chunk:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:, chunk:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" + end), + "branch:chunk:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:, chunk:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, location:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, data_store:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param session [String] + # + # @overload session_path(project:, location:, collection:, engine:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" + end), + "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb new file mode 100644 index 000000000000..3422d8a2ed02 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/session_service/credentials" +require "google/cloud/discovery_engine/v1/session_service/paths" +require "google/cloud/discovery_engine/v1/session_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing Sessions and Session-related resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/session_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + module SessionService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/session_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb new file mode 100644 index 000000000000..fc2cc4684e05 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb @@ -0,0 +1,859 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/session_service_pb" +require "google/cloud/discovery_engine/v1/session_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + module Rest + ## + # REST client for the SessionService service. + # + # Service for managing Sessions and Session-related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_service_stub + + ## + # Configure the SessionService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionService clients + # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_service_stub.universe_domain + end + + ## + # Create a new SessionService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @session_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @session_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_service_stub.endpoint + config.universe_domain = @session_service_stub.universe_domain + config.logger = @session_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @session_service_stub.logger + end + + # Service calls + + ## + # Creates a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already + # exists, an ALREADY_EXISTS error is returned. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_session(parent: nil, session: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The session to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.create_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Session. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does + # not exist, a NOT_FOUND error is returned. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_session(name: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.delete_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Session. + # + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be + # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to + # update does not exist, a NOT_FOUND error is returned. + # + # @overload update_session(request, options = nil) + # Pass arguments to `update_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_session(session: nil, update_mask: nil) + # Pass arguments to `update_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] + # Required. The Session to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} + # + # If not set or empty, all supported fields are updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + # + # # Call the update_session method. + # result = client.update_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def update_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.update_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_session(name: nil, include_answer_details: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the Session to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @param include_answer_details [::Boolean] + # Optional. If set to true, the full session including all answer details + # will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.get_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Sessions by their parent + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @param page_size [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSessions` call. + # Provide this to retrieve the subsequent page. + # @param filter [::String] + # A comma-separated list of fields to filter by, in EBNF grammar. + # The supported fields are: + # * `user_pseudo_id` + # * `state` + # * `display_name` + # * `starred` + # * `is_pinned` + # * `labels` + # * `create_time` + # * `update_time` + # + # Examples: + # "user_pseudo_id = some_id" + # "display_name = \"some_name\"" + # "starred = true" + # "is_pinned=true AND (NOT labels:hidden)" + # "create_time > \"1970-01-01T12:00:00Z\"" + # @param order_by [::String] + # 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` + # * `session_name` + # * `is_pinned` + # + # Example: + # + # * "update_time desc" + # * "create_time" + # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then + # by update_time. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_service_stub.list_sessions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_service_stub, :list_sessions, "sessions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionService REST API. + # + # This class represents the configuration for SessionService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SessionService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + ## + # RPC-specific configuration for `update_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session + @update_session = ::Gapic::Config::Method.new update_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb new file mode 100644 index 000000000000..65acba2903f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/session_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + module Rest + ## + # REST service stub for the SessionService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def create_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def update_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # A result object deserialized from the server's reply + def get_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] + # A result object deserialized from the server's reply + def list_sessions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_sessions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session.name}", + body: "session", + matches: [ + ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_sessions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb new file mode 100644 index 000000000000..9e7d27415d8d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/site_search_engine_service/credentials" +require "google/cloud/discovery_engine/v1/site_search_engine_service/paths" +require "google/cloud/discovery_engine/v1/site_search_engine_service/operations" +require "google/cloud/discovery_engine/v1/site_search_engine_service/client" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing site search related resources. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/site_search_engine_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + module SiteSearchEngineService + end + end + end + end +end + +helper_path = ::File.join __dir__, "site_search_engine_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/site_search_engine_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb new file mode 100644 index 000000000000..ef25704d42b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb @@ -0,0 +1,2012 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + ## + # Client for the SiteSearchEngineService service. + # + # Service for managing site search related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :site_search_engine_service_stub + + ## + # Configure the SiteSearchEngineService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SiteSearchEngineService clients + # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SiteSearchEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @site_search_engine_service_stub.universe_domain + end + + ## + # Create a new SiteSearchEngineService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SiteSearchEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/site_search_engine_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @site_search_engine_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @site_search_engine_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @site_search_engine_service_stub.endpoint + config.universe_domain = @site_search_engine_service_stub.universe_domain + config.logger = @site_search_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @site_search_engine_service_stub.logger + end + + # Service calls + + ## + # Gets the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}. + # + # @overload get_site_search_engine(request, options = nil) + # Pass arguments to `get_site_search_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_site_search_engine(name: nil) + # Pass arguments to `get_site_search_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to access the [SiteSearchEngine], + # regardless of whether or not it exists, a PERMISSION_DENIED error is + # returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new + # + # # Call the get_site_search_engine method. + # result = client.get_site_search_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. + # p result + # + def get_site_search_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_site_search_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_site_search_engine.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_site_search_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :get_site_search_engine, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload create_target_site(request, options = nil) + # Pass arguments to `create_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_target_site(parent: nil, target_site: nil) + # Pass arguments to `create_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to + # create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new + # + # # Call the create_target_site method. + # result = client.create_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_target_site.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :create_target_site, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in a + # batch. + # + # @overload batch_create_target_sites(request, options = nil) + # Pass arguments to `batch_create_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_target_sites(parent: nil, requests: nil) + # Pass arguments to `batch_create_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all TargetSites being created. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # The parent field in the CreateBookRequest messages must either be empty or + # match this field. + # @param requests [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash>] + # Required. The request message specifying the resources to create. + # A maximum of 20 TargetSites can be created in a batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new + # + # # Call the batch_create_target_sites method. + # result = client.batch_create_target_sites request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_create_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_create_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_create_target_sites.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :batch_create_target_sites, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload get_target_site(request, options = nil) + # Pass arguments to `get_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_target_site(name: nil) + # Pass arguments to `get_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new + # + # # Call the get_target_site method. + # result = client.get_target_site request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p result + # + def get_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_target_site.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :get_target_site, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload update_target_site(request, options = nil) + # Pass arguments to `update_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_target_site(target_site: nil) + # Pass arguments to `update_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] + # Required. The target site to update. + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update + # does not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new + # + # # Call the update_target_site method. + # result = client.update_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.target_site&.name + header_params["target_site.name"] = request.target_site.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_target_site.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :update_target_site, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload delete_target_site(request, options = nil) + # Pass arguments to `delete_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_target_site(name: nil) + # Pass arguments to `delete_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new + # + # # Call the delete_target_site method. + # result = client.delete_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_target_site.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :delete_target_site, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s. + # + # @overload list_target_sites(request, options = nil) + # Pass arguments to `list_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_target_sites(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent site search engine resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site + # search engine, regardless of whether or not this branch exists, a + # PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token, received from a previous `ListTargetSites` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargetSites` + # must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new + # + # # Call the list_target_sites method. + # result = client.list_target_sites request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p item + # end + # + def list_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_target_sites.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :list_target_sites, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :list_target_sites, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. + # + # @overload create_sitemap(request, options = nil) + # Pass arguments to `create_sitemap` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_sitemap(parent: nil, sitemap: nil) + # Pass arguments to `create_sitemap` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param sitemap [::Google::Cloud::DiscoveryEngine::V1::Sitemap, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new + # + # # Call the create_sitemap method. + # result = client.create_sitemap request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_sitemap request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_sitemap.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_sitemap.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_sitemap.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :create_sitemap, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. + # + # @overload delete_sitemap(request, options = nil) + # Pass arguments to `delete_sitemap` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_sitemap(name: nil) + # Pass arguments to `delete_sitemap` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does + # not exist, a NOT_FOUND error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new + # + # # Call the delete_sitemap method. + # result = client.delete_sitemap request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_sitemap request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_sitemap.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_sitemap.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_sitemap.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :delete_sitemap, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in a + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload fetch_sitemaps(request, options = nil) + # Pass arguments to `fetch_sitemaps` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_sitemaps(parent: nil, matcher: nil) + # Pass arguments to `fetch_sitemaps` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param matcher [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher, ::Hash] + # Optional. If specified, fetches the matching + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, + # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new + # + # # Call the fetch_sitemaps method. + # result = client.fetch_sitemaps request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. + # p result + # + def fetch_sitemaps request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_sitemaps.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_sitemaps.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_sitemaps.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :fetch_sitemaps, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Upgrade from basic site search to advanced site search. + # + # @overload enable_advanced_site_search(request, options = nil) + # Pass arguments to `enable_advanced_site_search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload enable_advanced_site_search(site_search_engine: nil) + # Pass arguments to `enable_advanced_site_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new + # + # # Call the enable_advanced_site_search method. + # result = client.enable_advanced_site_search request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_advanced_site_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.enable_advanced_site_search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.site_search_engine + header_params["site_search_engine"] = request.site_search_engine + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_advanced_site_search.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_advanced_site_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :enable_advanced_site_search, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Downgrade from advanced site search to basic site search. + # + # @overload disable_advanced_site_search(request, options = nil) + # Pass arguments to `disable_advanced_site_search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload disable_advanced_site_search(site_search_engine: nil) + # Pass arguments to `disable_advanced_site_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new + # + # # Call the disable_advanced_site_search method. + # result = client.disable_advanced_site_search request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_advanced_site_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.disable_advanced_site_search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.site_search_engine + header_params["site_search_engine"] = request.site_search_engine + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_advanced_site_search.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_advanced_site_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :disable_advanced_site_search, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Request on-demand recrawl for a list of URIs. + # + # @overload recrawl_uris(request, options = nil) + # Pass arguments to `recrawl_uris` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload recrawl_uris(site_search_engine: nil, uris: nil, site_credential: nil) + # Pass arguments to `recrawl_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param uris [::Array<::String>] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in + # `site_search_engine`. + # @param site_credential [::String] + # Optional. Credential id to use for crawling. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new + # + # # Call the recrawl_uris method. + # result = client.recrawl_uris request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def recrawl_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.recrawl_uris.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.site_search_engine + header_params["site_search_engine"] = request.site_search_engine + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.recrawl_uris.timeout, + metadata: metadata, + retry_policy: @config.rpcs.recrawl_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :recrawl_uris, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verify target sites' ownership and validity. + # This API sends all the target sites under site search engine for + # verification. + # + # @overload batch_verify_target_sites(request, options = nil) + # Pass arguments to `batch_verify_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_verify_target_sites(parent: nil) + # Pass arguments to `batch_verify_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all TargetSites being verified. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new + # + # # Call the batch_verify_target_sites method. + # result = client.batch_verify_target_sites request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_verify_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_verify_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_verify_target_sites.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_verify_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :batch_verify_target_sites, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns list of target sites with its domain verification status. + # This method can only be called under data store with BASIC_SITE_SEARCH + # state at the moment. + # + # @overload fetch_domain_verification_status(request, options = nil) + # Pass arguments to `fetch_domain_verification_status` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_domain_verification_status(site_search_engine: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_domain_verification_status` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. The site search engine resource under which we fetch all the + # domain verification status. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token, received from a previous `FetchDomainVerificationStatus` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDomainVerificationStatus` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new + # + # # Call the fetch_domain_verification_status method. + # result = client.fetch_domain_verification_status request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p item + # end + # + def fetch_domain_verification_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.fetch_domain_verification_status.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.site_search_engine + header_params["site_search_engine"] = request.site_search_engine + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.fetch_domain_verification_status.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_domain_verification_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.call_rpc :fetch_domain_verification_status, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :fetch_domain_verification_status, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SiteSearchEngineService API. + # + # This class represents the configuration for SiteSearchEngineService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_site_search_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_site_search_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_site_search_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SiteSearchEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_site_search_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_site_search_engine + ## + # RPC-specific configuration for `create_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :create_target_site + ## + # RPC-specific configuration for `batch_create_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_target_sites + ## + # RPC-specific configuration for `get_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :get_target_site + ## + # RPC-specific configuration for `update_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :update_target_site + ## + # RPC-specific configuration for `delete_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_target_site + ## + # RPC-specific configuration for `list_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :list_target_sites + ## + # RPC-specific configuration for `create_sitemap` + # @return [::Gapic::Config::Method] + # + attr_reader :create_sitemap + ## + # RPC-specific configuration for `delete_sitemap` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_sitemap + ## + # RPC-specific configuration for `fetch_sitemaps` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_sitemaps + ## + # RPC-specific configuration for `enable_advanced_site_search` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_advanced_site_search + ## + # RPC-specific configuration for `disable_advanced_site_search` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_advanced_site_search + ## + # RPC-specific configuration for `recrawl_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :recrawl_uris + ## + # RPC-specific configuration for `batch_verify_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_verify_target_sites + ## + # RPC-specific configuration for `fetch_domain_verification_status` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_domain_verification_status + + # @private + def initialize parent_rpcs = nil + get_site_search_engine_config = parent_rpcs.get_site_search_engine if parent_rpcs.respond_to? :get_site_search_engine + @get_site_search_engine = ::Gapic::Config::Method.new get_site_search_engine_config + create_target_site_config = parent_rpcs.create_target_site if parent_rpcs.respond_to? :create_target_site + @create_target_site = ::Gapic::Config::Method.new create_target_site_config + batch_create_target_sites_config = parent_rpcs.batch_create_target_sites if parent_rpcs.respond_to? :batch_create_target_sites + @batch_create_target_sites = ::Gapic::Config::Method.new batch_create_target_sites_config + get_target_site_config = parent_rpcs.get_target_site if parent_rpcs.respond_to? :get_target_site + @get_target_site = ::Gapic::Config::Method.new get_target_site_config + update_target_site_config = parent_rpcs.update_target_site if parent_rpcs.respond_to? :update_target_site + @update_target_site = ::Gapic::Config::Method.new update_target_site_config + delete_target_site_config = parent_rpcs.delete_target_site if parent_rpcs.respond_to? :delete_target_site + @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config + list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites + @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config + create_sitemap_config = parent_rpcs.create_sitemap if parent_rpcs.respond_to? :create_sitemap + @create_sitemap = ::Gapic::Config::Method.new create_sitemap_config + delete_sitemap_config = parent_rpcs.delete_sitemap if parent_rpcs.respond_to? :delete_sitemap + @delete_sitemap = ::Gapic::Config::Method.new delete_sitemap_config + fetch_sitemaps_config = parent_rpcs.fetch_sitemaps if parent_rpcs.respond_to? :fetch_sitemaps + @fetch_sitemaps = ::Gapic::Config::Method.new fetch_sitemaps_config + enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search + @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config + disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search + @disable_advanced_site_search = ::Gapic::Config::Method.new disable_advanced_site_search_config + recrawl_uris_config = parent_rpcs.recrawl_uris if parent_rpcs.respond_to? :recrawl_uris + @recrawl_uris = ::Gapic::Config::Method.new recrawl_uris_config + batch_verify_target_sites_config = parent_rpcs.batch_verify_target_sites if parent_rpcs.respond_to? :batch_verify_target_sites + @batch_verify_target_sites = ::Gapic::Config::Method.new batch_verify_target_sites_config + fetch_domain_verification_status_config = parent_rpcs.fetch_domain_verification_status if parent_rpcs.respond_to? :fetch_domain_verification_status + @fetch_domain_verification_status = ::Gapic::Config::Method.new fetch_domain_verification_status_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb new file mode 100644 index 000000000000..47f5e77408cf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + # Credentials for the SiteSearchEngineService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb new file mode 100644 index 000000000000..28ea9d723c43 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SiteSearchEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SiteSearchEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb new file mode 100644 index 000000000000..23cea989d014 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + # Path helper methods for the SiteSearchEngineService API. + module Paths + ## + # Create a fully-qualified SiteSearchEngine resource string. + # + # @overload site_search_engine_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload site_search_engine_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def site_search_engine_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Sitemap resource string. + # + # @overload sitemap_path(project:, location:, data_store:, sitemap:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param sitemap [String] + # + # @overload sitemap_path(project:, location:, collection:, data_store:, sitemap:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param sitemap [String] + # + # @return [::String] + def sitemap_path **args + resources = { + "data_store:location:project:sitemap" => (proc do |project:, location:, data_store:, sitemap:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}" + end), + "collection:data_store:location:project:sitemap" => (proc do |project:, location:, collection:, data_store:, sitemap:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified TargetSite resource string. + # + # @overload target_site_path(project:, location:, data_store:, target_site:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param target_site [String] + # + # @overload target_site_path(project:, location:, collection:, data_store:, target_site:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param target_site [String] + # + # @return [::String] + def target_site_path **args + resources = { + "data_store:location:project:target_site" => (proc do |project:, location:, data_store:, target_site:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine/targetSites/#{target_site}" + end), + "collection:data_store:location:project:target_site" => (proc do |project:, location:, collection:, data_store:, target_site:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine/targetSites/#{target_site}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb new file mode 100644 index 000000000000..5e9d7aa6ba36 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/site_search_engine_service/credentials" +require "google/cloud/discovery_engine/v1/site_search_engine_service/paths" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing site search related resources. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + module SiteSearchEngineService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb new file mode 100644 index 000000000000..5f426936c5f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb @@ -0,0 +1,1864 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + module Rest + ## + # REST client for the SiteSearchEngineService service. + # + # Service for managing site search related resources. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :site_search_engine_service_stub + + ## + # Configure the SiteSearchEngineService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SiteSearchEngineService clients + # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SiteSearchEngineService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @site_search_engine_service_stub.universe_domain + end + + ## + # Create a new SiteSearchEngineService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SiteSearchEngineService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @site_search_engine_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @site_search_engine_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @site_search_engine_service_stub.endpoint + config.universe_domain = @site_search_engine_service_stub.universe_domain + config.logger = @site_search_engine_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @site_search_engine_service_stub.logger + end + + # Service calls + + ## + # Gets the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}. + # + # @overload get_site_search_engine(request, options = nil) + # Pass arguments to `get_site_search_engine` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_site_search_engine(name: nil) + # Pass arguments to `get_site_search_engine` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to access the [SiteSearchEngine], + # regardless of whether or not it exists, a PERMISSION_DENIED error is + # returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new + # + # # Call the get_site_search_engine method. + # result = client.get_site_search_engine request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. + # p result + # + def get_site_search_engine request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_site_search_engine.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_site_search_engine.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_site_search_engine.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.get_site_search_engine request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload create_target_site(request, options = nil) + # Pass arguments to `create_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_target_site(parent: nil, target_site: nil) + # Pass arguments to `create_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to + # create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new + # + # # Call the create_target_site method. + # result = client.create_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_target_site.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.create_target_site request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in a + # batch. + # + # @overload batch_create_target_sites(request, options = nil) + # Pass arguments to `batch_create_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_target_sites(parent: nil, requests: nil) + # Pass arguments to `batch_create_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all TargetSites being created. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # The parent field in the CreateBookRequest messages must either be empty or + # match this field. + # @param requests [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash>] + # Required. The request message specifying the resources to create. + # A maximum of 20 TargetSites can be created in a batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new + # + # # Call the batch_create_target_sites method. + # result = client.batch_create_target_sites request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_create_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_create_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_create_target_sites.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.batch_create_target_sites request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload get_target_site(request, options = nil) + # Pass arguments to `get_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_target_site(name: nil) + # Pass arguments to `get_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new + # + # # Call the get_target_site method. + # result = client.get_target_site request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p result + # + def get_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_target_site.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.get_target_site request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload update_target_site(request, options = nil) + # Pass arguments to `update_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_target_site(target_site: nil) + # Pass arguments to `update_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] + # Required. The target site to update. + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update + # does not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new + # + # # Call the update_target_site method. + # result = client.update_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_target_site.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.update_target_site request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + # + # @overload delete_target_site(request, options = nil) + # Pass arguments to `delete_target_site` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_target_site(name: nil) + # Pass arguments to `delete_target_site` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new + # + # # Call the delete_target_site method. + # result = client.delete_target_site request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_target_site request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_target_site.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_target_site.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_target_site.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.delete_target_site request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s. + # + # @overload list_target_sites(request, options = nil) + # Pass arguments to `list_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_target_sites(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent site search engine resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site + # search engine, regardless of whether or not this branch exists, a + # PERMISSION_DENIED error is returned. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token, received from a previous `ListTargetSites` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargetSites` + # must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new + # + # # Call the list_target_sites method. + # result = client.list_target_sites request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p item + # end + # + def list_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_target_sites.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.list_target_sites request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @site_search_engine_service_stub, :list_target_sites, "target_sites", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. + # + # @overload create_sitemap(request, options = nil) + # Pass arguments to `create_sitemap` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_sitemap(parent: nil, sitemap: nil) + # Pass arguments to `create_sitemap` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param sitemap [::Google::Cloud::DiscoveryEngine::V1::Sitemap, ::Hash] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new + # + # # Call the create_sitemap method. + # result = client.create_sitemap request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_sitemap request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_sitemap.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_sitemap.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_sitemap.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.create_sitemap request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. + # + # @overload delete_sitemap(request, options = nil) + # Pass arguments to `delete_sitemap` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_sitemap(name: nil) + # Pass arguments to `delete_sitemap` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does + # not exist, a NOT_FOUND error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new + # + # # Call the delete_sitemap method. + # result = client.delete_sitemap request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_sitemap request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_sitemap.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_sitemap.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_sitemap.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.delete_sitemap request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Fetch {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in a + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # + # @overload fetch_sitemaps(request, options = nil) + # Pass arguments to `fetch_sitemaps` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_sitemaps(parent: nil, matcher: nil) + # Pass arguments to `fetch_sitemaps` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param matcher [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher, ::Hash] + # Optional. If specified, fetches the matching + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, + # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new + # + # # Call the fetch_sitemaps method. + # result = client.fetch_sitemaps request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. + # p result + # + def fetch_sitemaps request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_sitemaps.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_sitemaps.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_sitemaps.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.fetch_sitemaps request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Upgrade from basic site search to advanced site search. + # + # @overload enable_advanced_site_search(request, options = nil) + # Pass arguments to `enable_advanced_site_search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload enable_advanced_site_search(site_search_engine: nil) + # Pass arguments to `enable_advanced_site_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new + # + # # Call the enable_advanced_site_search method. + # result = client.enable_advanced_site_search request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def enable_advanced_site_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.enable_advanced_site_search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_advanced_site_search.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_advanced_site_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.enable_advanced_site_search request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Downgrade from advanced site search to basic site search. + # + # @overload disable_advanced_site_search(request, options = nil) + # Pass arguments to `disable_advanced_site_search` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload disable_advanced_site_search(site_search_engine: nil) + # Pass arguments to `disable_advanced_site_search` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new + # + # # Call the disable_advanced_site_search method. + # result = client.disable_advanced_site_search request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def disable_advanced_site_search request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.disable_advanced_site_search.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_advanced_site_search.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_advanced_site_search.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.disable_advanced_site_search request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Request on-demand recrawl for a list of URIs. + # + # @overload recrawl_uris(request, options = nil) + # Pass arguments to `recrawl_uris` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload recrawl_uris(site_search_engine: nil, uris: nil, site_credential: nil) + # Pass arguments to `recrawl_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @param uris [::Array<::String>] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in + # `site_search_engine`. + # @param site_credential [::String] + # Optional. Credential id to use for crawling. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new + # + # # Call the recrawl_uris method. + # result = client.recrawl_uris request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def recrawl_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.recrawl_uris.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.recrawl_uris.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.recrawl_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.recrawl_uris request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Verify target sites' ownership and validity. + # This API sends all the target sites under site search engine for + # verification. + # + # @overload batch_verify_target_sites(request, options = nil) + # Pass arguments to `batch_verify_target_sites` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_verify_target_sites(parent: nil) + # Pass arguments to `batch_verify_target_sites` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource shared by all TargetSites being verified. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new + # + # # Call the batch_verify_target_sites method. + # result = client.batch_verify_target_sites request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_verify_target_sites request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_verify_target_sites.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_verify_target_sites.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_verify_target_sites.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.batch_verify_target_sites request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns list of target sites with its domain verification status. + # This method can only be called under data store with BASIC_SITE_SEARCH + # state at the moment. + # + # @overload fetch_domain_verification_status(request, options = nil) + # Pass arguments to `fetch_domain_verification_status` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_domain_verification_status(site_search_engine: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_domain_verification_status` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param site_search_engine [::String] + # Required. The site search engine resource under which we fetch all the + # domain verification status. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # A page token, received from a previous `FetchDomainVerificationStatus` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDomainVerificationStatus` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new + # + # # Call the fetch_domain_verification_status method. + # result = client.fetch_domain_verification_status request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + # p item + # end + # + def fetch_domain_verification_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.fetch_domain_verification_status.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.fetch_domain_verification_status.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_domain_verification_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @site_search_engine_service_stub.fetch_domain_verification_status request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @site_search_engine_service_stub, :fetch_domain_verification_status, "target_sites", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SiteSearchEngineService REST API. + # + # This class represents the configuration for SiteSearchEngineService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_site_search_engine to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_site_search_engine.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_site_search_engine.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SiteSearchEngineService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_site_search_engine` + # @return [::Gapic::Config::Method] + # + attr_reader :get_site_search_engine + ## + # RPC-specific configuration for `create_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :create_target_site + ## + # RPC-specific configuration for `batch_create_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_target_sites + ## + # RPC-specific configuration for `get_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :get_target_site + ## + # RPC-specific configuration for `update_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :update_target_site + ## + # RPC-specific configuration for `delete_target_site` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_target_site + ## + # RPC-specific configuration for `list_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :list_target_sites + ## + # RPC-specific configuration for `create_sitemap` + # @return [::Gapic::Config::Method] + # + attr_reader :create_sitemap + ## + # RPC-specific configuration for `delete_sitemap` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_sitemap + ## + # RPC-specific configuration for `fetch_sitemaps` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_sitemaps + ## + # RPC-specific configuration for `enable_advanced_site_search` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_advanced_site_search + ## + # RPC-specific configuration for `disable_advanced_site_search` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_advanced_site_search + ## + # RPC-specific configuration for `recrawl_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :recrawl_uris + ## + # RPC-specific configuration for `batch_verify_target_sites` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_verify_target_sites + ## + # RPC-specific configuration for `fetch_domain_verification_status` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_domain_verification_status + + # @private + def initialize parent_rpcs = nil + get_site_search_engine_config = parent_rpcs.get_site_search_engine if parent_rpcs.respond_to? :get_site_search_engine + @get_site_search_engine = ::Gapic::Config::Method.new get_site_search_engine_config + create_target_site_config = parent_rpcs.create_target_site if parent_rpcs.respond_to? :create_target_site + @create_target_site = ::Gapic::Config::Method.new create_target_site_config + batch_create_target_sites_config = parent_rpcs.batch_create_target_sites if parent_rpcs.respond_to? :batch_create_target_sites + @batch_create_target_sites = ::Gapic::Config::Method.new batch_create_target_sites_config + get_target_site_config = parent_rpcs.get_target_site if parent_rpcs.respond_to? :get_target_site + @get_target_site = ::Gapic::Config::Method.new get_target_site_config + update_target_site_config = parent_rpcs.update_target_site if parent_rpcs.respond_to? :update_target_site + @update_target_site = ::Gapic::Config::Method.new update_target_site_config + delete_target_site_config = parent_rpcs.delete_target_site if parent_rpcs.respond_to? :delete_target_site + @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config + list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites + @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config + create_sitemap_config = parent_rpcs.create_sitemap if parent_rpcs.respond_to? :create_sitemap + @create_sitemap = ::Gapic::Config::Method.new create_sitemap_config + delete_sitemap_config = parent_rpcs.delete_sitemap if parent_rpcs.respond_to? :delete_sitemap + @delete_sitemap = ::Gapic::Config::Method.new delete_sitemap_config + fetch_sitemaps_config = parent_rpcs.fetch_sitemaps if parent_rpcs.respond_to? :fetch_sitemaps + @fetch_sitemaps = ::Gapic::Config::Method.new fetch_sitemaps_config + enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search + @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config + disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search + @disable_advanced_site_search = ::Gapic::Config::Method.new disable_advanced_site_search_config + recrawl_uris_config = parent_rpcs.recrawl_uris if parent_rpcs.respond_to? :recrawl_uris + @recrawl_uris = ::Gapic::Config::Method.new recrawl_uris_config + batch_verify_target_sites_config = parent_rpcs.batch_verify_target_sites if parent_rpcs.respond_to? :batch_verify_target_sites + @batch_verify_target_sites = ::Gapic::Config::Method.new batch_verify_target_sites_config + fetch_domain_verification_status_config = parent_rpcs.fetch_domain_verification_status if parent_rpcs.respond_to? :fetch_domain_verification_status + @fetch_domain_verification_status = ::Gapic::Config::Method.new fetch_domain_verification_status_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb new file mode 100644 index 000000000000..39d5ff1d3a5b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SiteSearchEngineService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SiteSearchEngineService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb new file mode 100644 index 000000000000..f6aadf6f56fc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb @@ -0,0 +1,1102 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + module Rest + ## + # REST service stub for the SiteSearchEngineService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_site_search_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] + # A result object deserialized from the server's reply + def get_site_search_engine request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_site_search_engine_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_site_search_engine", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_target_site request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_target_site_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_target_site", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_create_target_sites request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_target_sites_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_create_target_sites", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # A result object deserialized from the server's reply + def get_target_site request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_target_site_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_target_site", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_target_site request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_target_site_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_target_site", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_target_site request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_target_site_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_target_site", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse] + # A result object deserialized from the server's reply + def list_target_sites request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_target_sites_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_target_sites", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_sitemap REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_sitemap request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_sitemap_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_sitemap", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_sitemap REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_sitemap request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_sitemap_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_sitemap", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_sitemaps REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] + # A result object deserialized from the server's reply + def fetch_sitemaps request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_sitemaps_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_sitemaps", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the enable_advanced_site_search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def enable_advanced_site_search request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_advanced_site_search_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "enable_advanced_site_search", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_advanced_site_search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def disable_advanced_site_search request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_advanced_site_search_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "disable_advanced_site_search", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the recrawl_uris REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def recrawl_uris request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_recrawl_uris_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "recrawl_uris", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_verify_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_verify_target_sites request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_verify_target_sites_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_verify_target_sites", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_domain_verification_status REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse] + # A result object deserialized from the server's reply + def fetch_domain_verification_status request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_domain_verification_status_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "fetch_domain_verification_status", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_site_search_engine REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_site_search_engine_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_target_site_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/targetSites", + body: "target_site", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/targetSites", + body: "target_site", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_target_sites_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/targetSites:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/targetSites:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_target_site_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_target_site_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{target_site.name}", + body: "target_site", + matches: [ + ["target_site.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{target_site.name}", + body: "target_site", + matches: [ + ["target_site.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_target_site REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_target_site_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_target_sites_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/targetSites", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/targetSites", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_sitemap REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_sitemap_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sitemaps", + body: "sitemap", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sitemaps", + body: "sitemap", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_sitemap REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_sitemap_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/sitemaps/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/sitemaps/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_sitemaps REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_sitemaps_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sitemaps:fetch", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sitemaps:fetch", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_advanced_site_search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_advanced_site_search_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:enableAdvancedSiteSearch", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:enableAdvancedSiteSearch", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_advanced_site_search REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_advanced_site_search_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:disableAdvancedSiteSearch", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:disableAdvancedSiteSearch", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the recrawl_uris REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_recrawl_uris_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:recrawlUris", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{site_search_engine}:recrawlUris", + body: "*", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_verify_target_sites REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_verify_target_sites_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:batchVerifyTargetSites", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_domain_verification_status REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_domain_verification_status_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{site_search_engine}:fetchDomainVerificationStatus", + matches: [ + ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb new file mode 100644 index 000000000000..1e5b40576e42 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/user_event_service/credentials" +require "google/cloud/discovery_engine/v1/user_event_service/paths" +require "google/cloud/discovery_engine/v1/user_event_service/operations" +require "google/cloud/discovery_engine/v1/user_event_service/client" +require "google/cloud/discovery_engine/v1/user_event_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ingesting end user actions on a website to Discovery Engine API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/user_event_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/user_event_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + module UserEventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb new file mode 100644 index 000000000000..f2b98a35366a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb @@ -0,0 +1,911 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/user_event_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + ## + # Client for the UserEventService service. + # + # Service for ingesting end user actions on a website to Discovery Engine API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_user_events.timeout = 300.0 + default_config.rpcs.import_user_events.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_event_service_stub.universe_domain + end + + ## + # Create a new UserEventService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserEventService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/user_event_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @user_event_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @user_event_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + config.logger = @user_event_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @user_event_service_stub.logger + end + + # Service calls + + ## + # Writes a single user event. + # + # @overload write_user_event(request, options = nil) + # Pass arguments to `write_user_event` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) + # Pass arguments to `write_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # If the write user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the write user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] + # Required. User event to write. + # @param write_async [::Boolean] + # If set to true, the user event is written asynchronously after + # validation, and the API responds without waiting for the write. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. + # p result + # + def write_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.write_user_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.write_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload collect_user_event(request, options = nil) + # Pass arguments to `collect_user_event` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload collect_user_event(parent: nil, user_event: nil, uri: nil, ets: nil) + # Pass arguments to `collect_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # If the collect user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the collect user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @param uri [::String] + # 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. + # @param ets [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Api::HttpBody] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def collect_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.collect_user_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.collect_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload purge_user_events(request, options = nil) + # Pass arguments to `purge_user_events` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_user_events(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. + # @param filter [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. + # + # Note: This API only supports purging a max range of 30 days. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` + # * Deleting all events for a specific visitor in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` + # * Deleting the past 30 days of events inside a DataStore: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new + # + # # Call the purge_user_events method. + # result = client.purge_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.purge_user_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload import_user_events(request, options = nil) + # Pass arguments to `import_user_events` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_user_events(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) + # Pass arguments to `import_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource, ::Hash] + # The Inline source for the input content for UserEvents. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. Parent DataStore resource name, of the form + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_user_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the UserEventService API. + # + # This class represents the configuration for UserEventService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # write_user_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the UserEventService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `write_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :write_user_event + ## + # RPC-specific configuration for `collect_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :collect_user_event + ## + # RPC-specific configuration for `purge_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_user_events + ## + # RPC-specific configuration for `import_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :import_user_events + + # @private + def initialize parent_rpcs = nil + write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event + @write_user_event = ::Gapic::Config::Method.new write_user_event_config + collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event + @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config + purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events + @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config + import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events + @import_user_events = ::Gapic::Config::Method.new import_user_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb new file mode 100644 index 000000000000..5d45c78a49c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + # Credentials for the UserEventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb new file mode 100644 index 000000000000..eb1e9e4321bc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserEventService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb new file mode 100644 index 000000000000..43921115be39 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + # Path helper methods for the UserEventService API. + module Paths + ## + # Create a fully-qualified DataStore resource string. + # + # @overload data_store_path(project:, location:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # + # @overload data_store_path(project:, location:, collection:, data_store:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # + # @return [::String] + def data_store_path **args + resources = { + "data_store:location:project" => (proc do |project:, location:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}" + end), + "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, location:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param data_store [String] + # @param branch [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end), + "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" + raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Engine resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + # + # @param project [String] + # @param location [String] + # @param collection [String] + # @param engine [String] + # + # @return [::String] + def engine_path project:, location:, collection:, engine: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb new file mode 100644 index 000000000000..8a5c39a51034 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/user_event_service/credentials" +require "google/cloud/discovery_engine/v1/user_event_service/paths" +require "google/cloud/discovery_engine/v1/user_event_service/rest/operations" +require "google/cloud/discovery_engine/v1/user_event_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for ingesting end user actions on a website to Discovery Engine API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/user_event_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + module UserEventService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb new file mode 100644 index 000000000000..8548401fae1e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb @@ -0,0 +1,840 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/user_event_service_pb" +require "google/cloud/discovery_engine/v1/user_event_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + module Rest + ## + # REST client for the UserEventService service. + # + # Service for ingesting end user actions on a website to Discovery Engine API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_event_service_stub + + ## + # Configure the UserEventService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserEventService clients + # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 30.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.import_user_events.timeout = 300.0 + default_config.rpcs.import_user_events.retry_policy = { + initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_event_service_stub.universe_domain + end + + ## + # Create a new UserEventService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserEventService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @user_event_service_stub = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @user_event_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_event_service_stub.endpoint + config.universe_domain = @user_event_service_stub.universe_domain + config.logger = @user_event_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @user_event_service_stub.logger + end + + # Service calls + + ## + # Writes a single user event. + # + # @overload write_user_event(request, options = nil) + # Pass arguments to `write_user_event` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) + # Pass arguments to `write_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # If the write user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the write user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] + # Required. User event to write. + # @param write_async [::Boolean] + # If set to true, the user event is written asynchronously after + # validation, and the API responds without waiting for the write. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. + # p result + # + def write_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.write_user_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.write_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.write_user_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload collect_user_event(request, options = nil) + # Pass arguments to `collect_user_event` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload collect_user_event(parent: nil, user_event: nil, uri: nil, ets: nil) + # Pass arguments to `collect_user_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name. + # If the collect user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the collect user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @param user_event [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @param uri [::String] + # 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. + # @param ets [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # + def collect_user_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.collect_user_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.collect_user_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.collect_user_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload purge_user_events(request, options = nil) + # Pass arguments to `purge_user_events` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_user_events(parent: nil, filter: nil, force: nil) + # Pass arguments to `purge_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. + # @param filter [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. + # + # Note: This API only supports purging a max range of 30 days. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` + # * Deleting all events for a specific visitor in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` + # * Deleting the past 30 days of events inside a DataStore: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # @param force [::Boolean] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new + # + # # Call the purge_user_events method. + # result = client.purge_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def purge_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.purge_user_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.purge_user_events request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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. + # + # @overload import_user_events(request, options = nil) + # Pass arguments to `import_user_events` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_user_events(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) + # Pass arguments to `import_user_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource, ::Hash] + # The Inline source for the input content for UserEvents. + # + # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] + # Cloud Storage location for the input content. + # + # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] + # BigQuery input source. + # + # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param parent [::String] + # Required. Parent DataStore resource name, of the form + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_user_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_user_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_user_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_event_service_stub.import_user_events request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the UserEventService REST API. + # + # This class represents the configuration for UserEventService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # write_user_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.write_user_event.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the UserEventService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `write_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :write_user_event + ## + # RPC-specific configuration for `collect_user_event` + # @return [::Gapic::Config::Method] + # + attr_reader :collect_user_event + ## + # RPC-specific configuration for `purge_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_user_events + ## + # RPC-specific configuration for `import_user_events` + # @return [::Gapic::Config::Method] + # + attr_reader :import_user_events + + # @private + def initialize parent_rpcs = nil + write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event + @write_user_event = ::Gapic::Config::Method.new write_user_event_config + collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event + @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config + purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events + @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config + import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events + @import_user_events = ::Gapic::Config::Method.new import_user_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb new file mode 100644 index 000000000000..96b7418237d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserEventService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the UserEventService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb new file mode 100644 index 000000000000..9dc12fd6b9e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb @@ -0,0 +1,382 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/user_event_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + module Rest + ## + # REST service stub for the UserEventService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the write_user_event REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # A result object deserialized from the server's reply + def write_user_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "write_user_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the collect_user_event REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Api::HttpBody] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Api::HttpBody] + # A result object deserialized from the server's reply + def collect_user_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "collect_user_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_user_events REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def purge_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_user_events_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "purge_user_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_user_events REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_user_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_user_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the write_user_event REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_write_user_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:write", + body: "user_event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:write", + body: "user_event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:write", + body: "user_event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the collect_user_event REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_collect_user_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/userEvents:collect", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/userEvents:collect", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/userEvents:collect", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_user_events REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:purge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_user_events REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_user_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/userEvents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb new file mode 100644 index 000000000000..552b1f212e4b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/user_license_service/credentials" +require "google/cloud/discovery_engine/v1/user_license_service/paths" +require "google/cloud/discovery_engine/v1/user_license_service/operations" +require "google/cloud/discovery_engine/v1/user_license_service/client" +require "google/cloud/discovery_engine/v1/user_license_service/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing User Licenses. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/discovery_engine/v1/user_license_service" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/discovery_engine/v1/user_license_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new + # + module UserLicenseService + end + end + end + end +end + +helper_path = ::File.join __dir__, "user_license_service", "helpers.rb" +require "google/cloud/discovery_engine/v1/user_license_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb new file mode 100644 index 000000000000..9da049ab7849 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb @@ -0,0 +1,647 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/user_license_service_pb" +require "google/cloud/location" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + ## + # Client for the UserLicenseService service. + # + # Service for managing User Licenses. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_license_service_stub + + ## + # Configure the UserLicenseService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserLicenseService clients + # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserLicenseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_license_service_stub.universe_domain + end + + ## + # Create a new UserLicenseService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserLicenseService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/discoveryengine/v1/user_license_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @user_license_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @user_license_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_license_service_stub.endpoint + config.universe_domain = @user_license_service_stub.universe_domain + config.logger = @user_license_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @user_license_service_stub.logger + end + + # Service calls + + ## + # Lists the User Licenses. + # + # @overload list_user_licenses(request, options = nil) + # Pass arguments to `list_user_licenses` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_user_licenses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, defaults to 10. The maximum value is 50; values + # above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListUserLicenses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUserLicenses` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. Filter for the list request. + # + # Supported fields: + # + # * `license_assignment_state` + # + # Examples: + # + # * `license_assignment_state = ASSIGNED` to list assigned user licenses. + # * `license_assignment_state = NO_LICENSE` to list not licensed users. + # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users + # who attempted login but no license assigned. + # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter + # out users who attempted login but no license assigned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new + # + # # Call the list_user_licenses method. + # result = client.list_user_licenses request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. + # p item + # end + # + def list_user_licenses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_user_licenses.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_user_licenses.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_user_licenses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_license_service_stub.call_rpc :list_user_licenses, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @user_license_service_stub, :list_user_licenses, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the User License. + # This method is used for batch assign/unassign licenses to users. + # + # @overload batch_update_user_licenses(request, options = nil) + # Pass arguments to `batch_update_user_licenses` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) + # Pass arguments to `batch_update_user_licenses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash] + # The inline source for the input content for document embeddings. + # @param parent [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @param delete_unassigned_user_licenses [::Boolean] + # Optional. If true, if user licenses removed associated license config, the + # user license will be deleted. By default which is false, the user license + # will be updated to unassigned state. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new + # + # # Call the batch_update_user_licenses method. + # result = client.batch_update_user_licenses request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_update_user_licenses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.batch_update_user_licenses.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.batch_update_user_licenses.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_user_licenses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_license_service_stub.call_rpc :batch_update_user_licenses, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the UserLicenseService API. + # + # This class represents the configuration for UserLicenseService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_user_licenses to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_user_licenses.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_user_licenses.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the UserLicenseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_user_licenses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_user_licenses + ## + # RPC-specific configuration for `batch_update_user_licenses` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_user_licenses + + # @private + def initialize parent_rpcs = nil + list_user_licenses_config = parent_rpcs.list_user_licenses if parent_rpcs.respond_to? :list_user_licenses + @list_user_licenses = ::Gapic::Config::Method.new list_user_licenses_config + batch_update_user_licenses_config = parent_rpcs.batch_update_user_licenses if parent_rpcs.respond_to? :batch_update_user_licenses + @batch_update_user_licenses = ::Gapic::Config::Method.new batch_update_user_licenses_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb new file mode 100644 index 000000000000..5368c2b001d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + # Credentials for the UserLicenseService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb new file mode 100644 index 000000000000..d88dba5040dc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserLicenseService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the UserLicenseService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb new file mode 100644 index 000000000000..cf87417d889e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + # Path helper methods for the UserLicenseService API. + module Paths + ## + # Create a fully-qualified LicenseConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/licenseConfigs/{license_config}` + # + # @param project [String] + # @param location [String] + # @param license_config [String] + # + # @return [::String] + def license_config_path project:, location:, license_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/licenseConfigs/#{license_config}" + end + + ## + # Create a fully-qualified UserStore resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/userStores/{user_store}` + # + # @param project [String] + # @param location [String] + # @param user_store [String] + # + # @return [::String] + def user_store_path project:, location:, user_store: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/userStores/#{user_store}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb new file mode 100644 index 000000000000..9db035b4724f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/discovery_engine/v1/version" + +require "google/cloud/discovery_engine/v1/user_license_service/credentials" +require "google/cloud/discovery_engine/v1/user_license_service/paths" +require "google/cloud/discovery_engine/v1/user_license_service/rest/operations" +require "google/cloud/discovery_engine/v1/user_license_service/rest/client" + +module Google + module Cloud + module DiscoveryEngine + module V1 + ## + # Service for managing User Licenses. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/discovery_engine/v1/user_license_service/rest" + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new + # + module UserLicenseService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/discovery_engine/v1/user_license_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb new file mode 100644 index 000000000000..30ffa801bcb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb @@ -0,0 +1,590 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/discoveryengine/v1/user_license_service_pb" +require "google/cloud/discovery_engine/v1/user_license_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + module Rest + ## + # REST client for the UserLicenseService service. + # + # Service for managing User Licenses. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :user_license_service_stub + + ## + # Configure the UserLicenseService Client class. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all UserLicenseService clients + # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the UserLicenseService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @user_license_service_stub.universe_domain + end + + ## + # Create a new UserLicenseService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the UserLicenseService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @user_license_service_stub = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @user_license_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @user_license_service_stub.endpoint + config.universe_domain = @user_license_service_stub.universe_domain + config.logger = @user_license_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @user_license_service_stub.logger + end + + # Service calls + + ## + # Lists the User Licenses. + # + # @overload list_user_licenses(request, options = nil) + # Pass arguments to `list_user_licenses` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_user_licenses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, defaults to 10. The maximum value is 50; values + # above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListUserLicenses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUserLicenses` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. Filter for the list request. + # + # Supported fields: + # + # * `license_assignment_state` + # + # Examples: + # + # * `license_assignment_state = ASSIGNED` to list assigned user licenses. + # * `license_assignment_state = NO_LICENSE` to list not licensed users. + # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users + # who attempted login but no license assigned. + # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter + # out users who attempted login but no license assigned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new + # + # # Call the list_user_licenses method. + # result = client.list_user_licenses request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. + # p item + # end + # + def list_user_licenses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_user_licenses.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_user_licenses.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_user_licenses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_license_service_stub.list_user_licenses request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @user_license_service_stub, :list_user_licenses, "user_licenses", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the User License. + # This method is used for batch assign/unassign licenses to users. + # + # @overload batch_update_user_licenses(request, options = nil) + # Pass arguments to `batch_update_user_licenses` via a request object, either of type + # {::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) + # Pass arguments to `batch_update_user_licenses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash] + # The inline source for the input content for document embeddings. + # @param parent [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @param delete_unassigned_user_licenses [::Boolean] + # Optional. If true, if user licenses removed associated license config, the + # user license will be deleted. By default which is false, the user license + # will be updated to unassigned state. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new + # + # # Call the batch_update_user_licenses method. + # result = client.batch_update_user_licenses request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def batch_update_user_licenses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.batch_update_user_licenses.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.batch_update_user_licenses.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_user_licenses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @user_license_service_stub.batch_update_user_licenses request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the UserLicenseService REST API. + # + # This class represents the configuration for UserLicenseService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_user_licenses to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_user_licenses.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_user_licenses.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the UserLicenseService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_user_licenses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_user_licenses + ## + # RPC-specific configuration for `batch_update_user_licenses` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_user_licenses + + # @private + def initialize parent_rpcs = nil + list_user_licenses_config = parent_rpcs.list_user_licenses if parent_rpcs.respond_to? :list_user_licenses + @list_user_licenses = ::Gapic::Config::Method.new list_user_licenses_config + batch_update_user_licenses_config = parent_rpcs.batch_update_user_licenses if parent_rpcs.respond_to? :batch_update_user_licenses + @batch_update_user_licenses = ::Gapic::Config::Method.new batch_update_user_licenses_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb new file mode 100644 index 000000000000..f596f60966b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb @@ -0,0 +1,1159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the UserLicenseService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the UserLicenseService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb new file mode 100644 index 000000000000..ffaf1edda4ef --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb @@ -0,0 +1,204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/discoveryengine/v1/user_license_service_pb" + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + module Rest + ## + # REST service stub for the UserLicenseService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_user_licenses REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse] + # A result object deserialized from the server's reply + def list_user_licenses request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_user_licenses_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_user_licenses", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_update_user_licenses REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def batch_update_user_licenses request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_user_licenses_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "batch_update_user_licenses", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_user_licenses REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_user_licenses_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/userLicenses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/userStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_user_licenses REST call + # + # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_update_user_licenses_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:batchUpdateUserLicenses", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/userStores/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb new file mode 100644 index 000000000000..8866f397154c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb new file mode 100644 index 000000000000..75c21b8df255 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/answer.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/safety_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/discoveryengine/v1/answer.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/safety.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\'\n\x06\x41nswer\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12<\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.Answer.State\x12\x13\n\x0b\x61nswer_text\x18\x03 \x01(\t\x12\x1c\n\x0fgrounding_score\x18\x0c \x01(\x01H\x00\x88\x01\x01\x12\x43\n\tcitations\x18\x04 \x03(\x0b\x32\x30.google.cloud.discoveryengine.v1.Answer.Citation\x12Y\n\x12grounding_supports\x18\r \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.Answer.GroundingSupportB\x03\xe0\x41\x01\x12\x45\n\nreferences\x18\x05 \x03(\x0b\x32\x31.google.cloud.discoveryengine.v1.Answer.Reference\x12\x19\n\x11related_questions\x18\x06 \x03(\t\x12;\n\x05steps\x18\x07 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.Answer.Step\x12`\n\x18query_understanding_info\x18\n \x01(\x0b\x32>.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo\x12[\n\x16\x61nswer_skipped_reasons\x18\x0b \x03(\x0e\x32;.google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\x0esafety_ratings\x18\x0e \x03(\x0b\x32-.google.cloud.discoveryengine.v1.SafetyRatingB\x03\xe0\x41\x01\x1a{\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12G\n\x07sources\x18\x03 \x03(\x0b\x32\x36.google.cloud.discoveryengine.v1.Answer.CitationSource\x1a&\n\x0e\x43itationSource\x12\x14\n\x0creference_id\x18\x01 \x01(\t\x1a\x88\x02\n\x10GroundingSupport\x12\x18\n\x0bstart_index\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x16\n\tend_index\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12\x1c\n\x0fgrounding_score\x18\x03 \x01(\x01H\x00\x88\x01\x01\x12%\n\x18grounding_check_required\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12L\n\x07sources\x18\x05 \x03(\x0b\x32\x36.google.cloud.discoveryengine.v1.Answer.CitationSourceB\x03\xe0\x41\x01\x42\x12\n\x10_grounding_scoreB\x1b\n\x19_grounding_check_required\x1a\xa8\n\n\tReference\x12p\n\x1aunstructured_document_info\x18\x01 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfoH\x00\x12Q\n\nchunk_info\x18\x02 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfoH\x00\x12l\n\x18structured_document_info\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.Answer.Reference.StructuredDocumentInfoH\x00\x1a\x81\x03\n\x18UnstructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12o\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32W.google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent\x12,\n\x0bstruct_data\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1aj\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x42\x12\n\x10_relevance_score\x1a\xa9\x03\n\tChunkInfo\x12\x38\n\x05\x63hunk\x18\x01 \x01(\tB)\xfa\x41&\n$discoveryengine.googleapis.com/Chunk\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x12g\n\x11\x64ocument_metadata\x18\x04 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata\x1a\xb5\x01\n\x10\x44ocumentMetadata\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x04 \x01(\t\x12,\n\x0bstruct_data\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x12\n\x10_relevance_score\x1a\xac\x01\n\x16StructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12,\n\x0bstruct_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a\xbc\x08\n\x04Step\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32\x32.google.cloud.discoveryengine.v1.Answer.Step.State\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07thought\x18\x03 \x01(\t\x12\x44\n\x07\x61\x63tions\x18\x04 \x03(\x0b\x32\x33.google.cloud.discoveryengine.v1.Answer.Step.Action\x1a\xb8\x06\n\x06\x41\x63tion\x12Y\n\rsearch_action\x18\x02 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.Answer.Step.Action.SearchActionH\x00\x12T\n\x0bobservation\x18\x03 \x01(\x0b\x32?.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation\x1a\x1d\n\x0cSearchAction\x12\r\n\x05query\x18\x01 \x01(\t\x1a\xd3\x04\n\x0bObservation\x12\x64\n\x0esearch_results\x18\x02 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult\x1a\xdd\x03\n\x0cSearchResult\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12n\n\x0csnippet_info\x18\x04 \x03(\x0b\x32X.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo\x12j\n\nchunk_info\x18\x05 \x03(\x0b\x32V.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo\x12,\n\x0bstruct_data\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x36\n\x0bSnippetInfo\x12\x0f\n\x07snippet\x18\x01 \x01(\t\x12\x16\n\x0esnippet_status\x18\x02 \x01(\t\x1a]\n\tChunkInfo\x12\r\n\x05\x63hunk\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x42\x12\n\x10_relevance_scoreB\x08\n\x06\x61\x63tion\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x1a\xe1\x03\n\x16QueryUnderstandingInfo\x12y\n\x19query_classification_info\x18\x01 \x03(\x0b\x32V.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo\x1a\xcb\x02\n\x17QueryClassificationInfo\x12i\n\x04type\x18\x01 \x01(\x0e\x32[.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type\x12\x10\n\x08positive\x18\x02 \x01(\x08\"\xb2\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44VERSARIAL_QUERY\x10\x01\x12\x1c\n\x18NON_ANSWER_SEEKING_QUERY\x10\x02\x12\x17\n\x13JAIL_BREAKING_QUERY\x10\x03\x12\x1f\n\x1bNON_ANSWER_SEEKING_QUERY_V2\x10\x04\x12%\n!USER_DEFINED_CLASSIFICATION_QUERY\x10\x05\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\r\n\tSTREAMING\x10\x04\"\xa2\x03\n\x13\x41nswerSkippedReason\x12%\n!ANSWER_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12$\n NON_ANSWER_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x05\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x06\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x07\x12\'\n#NON_ANSWER_SEEKING_QUERY_IGNORED_V2\x10\x08\x12\x17\n\x13LOW_GROUNDED_ANSWER\x10\t\x12-\n)USER_DEFINED_CLASSIFICATION_QUERY_IGNORED\x10\n\x12\x14\n\x10UNHELPFUL_ANSWER\x10\x0b:\x85\x03\xea\x41\x81\x03\n%discoveryengine.googleapis.com/Answer\x12\x63projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}\x12|projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}\x12uprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}B\x12\n\x10_grounding_scoreB\xfe\x01\n#com.google.cloud.discoveryengine.v1B\x0b\x41nswerProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.SafetyRating", "google/cloud/discoveryengine/v1/safety.proto"], + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Answer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer").msgclass + Answer::Citation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Citation").msgclass + Answer::CitationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.CitationSource").msgclass + Answer::GroundingSupport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.GroundingSupport").msgclass + Answer::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference").msgclass + Answer::Reference::UnstructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo").msgclass + Answer::Reference::UnstructuredDocumentInfo::ChunkContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent").msgclass + Answer::Reference::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo").msgclass + Answer::Reference::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata").msgclass + Answer::Reference::StructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.StructuredDocumentInfo").msgclass + Answer::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step").msgclass + Answer::Step::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action").msgclass + Answer::Step::Action::SearchAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.SearchAction").msgclass + Answer::Step::Action::Observation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation").msgclass + Answer::Step::Action::Observation::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult").msgclass + Answer::Step::Action::Observation::SearchResult::SnippetInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo").msgclass + Answer::Step::Action::Observation::SearchResult::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo").msgclass + Answer::Step::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.State").enummodule + Answer::QueryUnderstandingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo").msgclass + Answer::QueryUnderstandingInfo::QueryClassificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo").msgclass + Answer::QueryUnderstandingInfo::QueryClassificationInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type").enummodule + Answer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.State").enummodule + Answer::AnswerSkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb new file mode 100644 index 000000000000..88f096da08b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/assist_answer.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n3google/cloud/discoveryengine/v1/assist_answer.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x8d\x06\n\x0c\x41ssistAnswer\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32\x33.google.cloud.discoveryengine.v1.AssistAnswer.State\x12\x44\n\x07replies\x18\x03 \x03(\x0b\x32\x33.google.cloud.discoveryengine.v1.AssistAnswer.Reply\x12\x61\n\x16\x61ssist_skipped_reasons\x18\x05 \x03(\x0e\x32\x41.google.cloud.discoveryengine.v1.AssistAnswer.AssistSkippedReason\x1ag\n\x05Reply\x12U\n\x10grounded_content\x18\x01 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AssistantGroundedContentH\x00\x42\x07\n\x05reply\"W\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0b\n\x07SKIPPED\x10\x04\"\x81\x01\n\x13\x41ssistSkippedReason\x12%\n!ASSIST_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12$\n NON_ASSIST_SEEKING_QUERY_IGNORED\x10\x01\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x02:\xb6\x01\xea\x41\xb2\x01\n+discoveryengine.googleapis.com/AssistAnswer\x12\x82\x01projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}\"\xb1\x06\n\x10\x41ssistantContent\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x12M\n\x0binline_data\x18\x03 \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.AssistantContent.BlobH\x00\x12\x46\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.AssistantContent.FileH\x00\x12[\n\x0f\x65xecutable_code\x18\x07 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.AssistantContent.ExecutableCodeH\x00\x12\x66\n\x15\x63ode_execution_result\x18\x08 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResultH\x00\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x14\n\x07thought\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x31\n\x04\x42lob\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x1a\x34\n\x04\x46ile\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66ile_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a#\n\x0e\x45xecutableCode\x12\x11\n\x04\x63ode\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xf6\x01\n\x13\x43odeExecutionResult\x12\x63\n\x07outcome\x18\x01 \x01(\x0e\x32M.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult.OutcomeB\x03\xe0\x41\x02\x12\x13\n\x06output\x18\x02 \x01(\tB\x03\xe0\x41\x01\"e\n\x07Outcome\x12\x17\n\x13OUTCOME_UNSPECIFIED\x10\x00\x12\x0e\n\nOUTCOME_OK\x10\x01\x12\x12\n\x0eOUTCOME_FAILED\x10\x02\x12\x1d\n\x19OUTCOME_DEADLINE_EXCEEDED\x10\x03\x42\x06\n\x04\x64\x61ta\"\xdf\x07\n\x18\x41ssistantGroundedContent\x12r\n\x17text_grounding_metadata\x18\x03 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadataH\x00\x12\x42\n\x07\x63ontent\x18\x01 \x01(\x0b\x32\x31.google.cloud.discoveryengine.v1.AssistantContent\x1a\xfe\x05\n\x15TextGroundingMetadata\x12i\n\x08segments\x18\x04 \x03(\x0b\x32W.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Segment\x12m\n\nreferences\x18\x02 \x03(\x0b\x32Y.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference\x1as\n\x07Segment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12\x19\n\x11reference_indices\x18\x04 \x03(\x05\x12\x17\n\x0fgrounding_score\x18\x05 \x01(\x02\x12\x0c\n\x04text\x18\x06 \x01(\t\x1a\x95\x03\n\tReference\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x85\x01\n\x11\x64ocument_metadata\x18\x02 \x01(\x0b\x32j.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference.DocumentMetadata\x1a\xee\x01\n\x10\x44ocumentMetadata\x12\x43\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentH\x00\x88\x01\x01\x12\x10\n\x03uri\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05title\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x1c\n\x0fpage_identifier\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x64omain\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x0b\n\t_documentB\x06\n\x04_uriB\x08\n\x06_titleB\x12\n\x10_page_identifierB\t\n\x07_domainB\n\n\x08metadataB\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11\x41ssistAnswerProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + AssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer").msgclass + AssistAnswer::Reply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.Reply").msgclass + AssistAnswer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.State").enummodule + AssistAnswer::AssistSkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.AssistSkippedReason").enummodule + AssistantContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent").msgclass + AssistantContent::Blob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.Blob").msgclass + AssistantContent::File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.File").msgclass + AssistantContent::ExecutableCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.ExecutableCode").msgclass + AssistantContent::CodeExecutionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult").msgclass + AssistantContent::CodeExecutionResult::Outcome = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult.Outcome").enummodule + AssistantGroundedContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent").msgclass + AssistantGroundedContent::TextGroundingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata").msgclass + AssistantGroundedContent::TextGroundingMetadata::Segment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Segment").msgclass + AssistantGroundedContent::TextGroundingMetadata::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference").msgclass + AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference.DocumentMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb new file mode 100644 index 000000000000..248652636560 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/assistant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n/google/cloud/discoveryengine/v1/assistant.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb9\x01\n\tAssistant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05:\x98\x01\xea\x41\x94\x01\n(discoveryengine.googleapis.com/Assistant\x12hprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}B\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x41ssistantProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Assistant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Assistant").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb new file mode 100644 index 000000000000..f9d6f1816674 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/assistant_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/assist_answer_pb' +require 'google/cloud/discoveryengine/v1/search_service_pb' +require 'google/cloud/discoveryengine/v1/session_pb' + + +descriptor_data = "\n7google/cloud/discoveryengine/v1/assistant_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/assist_answer.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\"R\n\x12\x41ssistUserMetadata\x12\x16\n\ttime_zone\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17preferred_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xba\t\n\x13StreamAssistRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/Assistant\x12:\n\x05query\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.QueryB\x03\xe0\x41\x01\x12?\n\x07session\x18\x03 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12O\n\ruser_metadata\x18\x06 \x01(\x0b\x32\x33.google.cloud.discoveryengine.v1.AssistUserMetadataB\x03\xe0\x41\x01\x12W\n\ntools_spec\x18\x12 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpecB\x03\xe0\x41\x01\x12\x61\n\x0fgeneration_spec\x18\x13 \x01(\x0b\x32\x43.google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpecB\x03\xe0\x41\x01\x1a\xaf\x05\n\tToolsSpec\x12u\n\x15vertex_ai_search_spec\x18\x01 \x01(\x0b\x32Q.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VertexAiSearchSpecB\x03\xe0\x41\x01\x12p\n\x12web_grounding_spec\x18\x02 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.WebGroundingSpecB\x03\xe0\x41\x01\x12v\n\x15image_generation_spec\x18\x03 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.ImageGenerationSpecB\x03\xe0\x41\x01\x12v\n\x15video_generation_spec\x18\x04 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VideoGenerationSpecB\x03\xe0\x41\x01\x1a\x86\x01\n\x12VertexAiSearchSpec\x12[\n\x10\x64\x61ta_store_specs\x18\x02 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpecB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x12\n\x10WebGroundingSpec\x1a\x15\n\x13ImageGenerationSpec\x1a\x15\n\x13VideoGenerationSpec\x1a\'\n\x0eGenerationSpec\x12\x15\n\x08model_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\x91\x02\n\x14StreamAssistResponse\x12=\n\x06\x61nswer\x18\x01 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.AssistAnswer\x12W\n\x0csession_info\x18\x02 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.StreamAssistResponse.SessionInfo\x12\x14\n\x0c\x61ssist_token\x18\x04 \x01(\t\x1aK\n\x0bSessionInfo\x12<\n\x07session\x18\x01 \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session2\xc6\x02\n\x10\x41ssistantService\x12\xdd\x01\n\x0cStreamAssist\x12\x34.google.cloud.discoveryengine.v1.StreamAssistRequest\x1a\x35.google.cloud.discoveryengine.v1.StreamAssistResponse\"^\x82\xd3\xe4\x93\x02X\"S/v1/{name=projects/*/locations/*/collections/*/engines/*/assistants/*}:streamAssist:\x01*0\x01\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15\x41ssistantServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.Query", "google/cloud/discoveryengine/v1/session.proto"], + ["google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec", "google/cloud/discoveryengine/v1/search_service.proto"], + ["google.cloud.discoveryengine.v1.AssistAnswer", "google/cloud/discoveryengine/v1/assist_answer.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + AssistUserMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistUserMetadata").msgclass + StreamAssistRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest").msgclass + StreamAssistRequest::ToolsSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec").msgclass + StreamAssistRequest::ToolsSpec::VertexAiSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VertexAiSearchSpec").msgclass + StreamAssistRequest::ToolsSpec::WebGroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.WebGroundingSpec").msgclass + StreamAssistRequest::ToolsSpec::ImageGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.ImageGenerationSpec").msgclass + StreamAssistRequest::ToolsSpec::VideoGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VideoGenerationSpec").msgclass + StreamAssistRequest::GenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpec").msgclass + StreamAssistResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistResponse").msgclass + StreamAssistResponse::SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistResponse.SessionInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb new file mode 100644 index 000000000000..5de4fd4e5cbb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/assistant_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/assistant_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module AssistantService + # Service for managing Assistant configuration and assisting users. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.AssistantService' + + # Assists the user with a query in a streaming fashion. + rpc :StreamAssist, ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, stream(::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb new file mode 100644 index 000000000000..85726d7ee387 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/chunk.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n+google/cloud/discoveryengine/v1/chunk.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xff\x0b\n\x05\x43hunk\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12!\n\x0frelevance_score\x18\x08 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12R\n\x11\x64ocument_metadata\x18\x05 \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Chunk.DocumentMetadata\x12\x39\n\x13\x64\x65rived_struct_data\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12\x42\n\tpage_span\x18\x06 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.Chunk.PageSpan\x12Q\n\x0e\x63hunk_metadata\x18\x07 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Chunk.ChunkMetadataB\x03\xe0\x41\x03\x12\x16\n\tdata_urls\x18\t \x03(\tB\x03\xe0\x41\x03\x12 \n\x13\x61nnotation_contents\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12[\n\x13\x61nnotation_metadata\x18\x0c \x03(\x0b\x32\x39.google.cloud.discoveryengine.v1.Chunk.AnnotationMetadataB\x03\xe0\x41\x03\x1a\\\n\x10\x44ocumentMetadata\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12,\n\x0bstruct_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x30\n\x08PageSpan\x12\x12\n\npage_start\x18\x01 \x01(\x05\x12\x10\n\x08page_end\x18\x02 \x01(\x05\x1a\x8d\x01\n\rChunkMetadata\x12?\n\x0fprevious_chunks\x18\x01 \x03(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12;\n\x0bnext_chunks\x18\x02 \x03(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x1a|\n\x11StructuredContent\x12Q\n\x0estructure_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.discoveryengine.v1.Chunk.StructureTypeB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x86\x01\n\x12\x41nnotationMetadata\x12Y\n\x12structured_content\x18\x01 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.Chunk.StructuredContentB\x03\xe0\x41\x03\x12\x15\n\x08image_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\"{\n\rStructureType\x12\x1e\n\x1aSTRUCTURE_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15SHAREHOLDER_STRUCTURE\x10\x01\x12\x17\n\x13SIGNATURE_STRUCTURE\x10\x02\x12\x16\n\x12\x43HECKBOX_STRUCTURE\x10\x03:\xb2\x02\xea\x41\xae\x02\n$discoveryengine.googleapis.com/Chunk\x12uprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}\x12\x8e\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}B\x12\n\x10_relevance_scoreB\xfd\x01\n#com.google.cloud.discoveryengine.v1B\nChunkProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Chunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk").msgclass + Chunk::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.DocumentMetadata").msgclass + Chunk::PageSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.PageSpan").msgclass + Chunk::ChunkMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.ChunkMetadata").msgclass + Chunk::StructuredContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.StructuredContent").msgclass + Chunk::AnnotationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata").msgclass + Chunk::StructureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.StructureType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb new file mode 100644 index 000000000000..f33f9d187550 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/cmek_config_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/discoveryengine/v1/cmek_config_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"p\n\x17UpdateCmekConfigRequest\x12@\n\x06\x63onfig\x18\x01 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x02\x12\x13\n\x0bset_default\x18\x02 \x01(\x08\"W\n\x14GetCmekConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfig\"N\n\x0fSingleRegionKey\x12;\n\x07kms_key\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"cloudkms.googleapis.com/CryptoKeys\"\xc1\x07\n\nCmekConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x07kms_key\x18\x02 \x01(\tB\'\xfa\x41$\n\"cloudkms.googleapis.com/CryptoKeys\x12G\n\x0fkms_key_version\x18\x06 \x01(\tB.\xfa\x41+\n)cloudkms.googleapis.com/CryptoKeyVersions\x12\x45\n\x05state\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.CmekConfig.StateB\x03\xe0\x41\x03\x12\x17\n\nis_default\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\x1elast_rotation_timestamp_micros\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12Q\n\x12single_region_keys\x18\x07 \x03(\x0b\x32\x30.google.cloud.discoveryengine.v1.SingleRegionKeyB\x03\xe0\x41\x01\x12Z\n\x10notebooklm_state\x18\x08 \x01(\x0e\x32;.google.cloud.discoveryengine.v1.CmekConfig.NotebookLMStateB\x03\xe0\x41\x03\"\x98\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\r\n\tKEY_ISSUE\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x11\n\rDELETE_FAILED\x10\x07\x12\x0c\n\x08UNUSABLE\x10\x05\x12\x13\n\x0f\x41\x43TIVE_ROTATING\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x08\"\x83\x01\n\x0fNotebookLMState\x12!\n\x1dNOTEBOOK_LM_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15NOTEBOOK_LM_NOT_READY\x10\x01\x12\x15\n\x11NOTEBOOK_LM_READY\x10\x02\x12\x1b\n\x17NOTEBOOK_LM_NOT_ENABLED\x10\x03:\xbf\x01\xea\x41\xbb\x01\n)discoveryengine.googleapis.com/CmekConfig\x12\x32projects/{project}/locations/{location}/cmekConfig\x12\x41projects/{project}/locations/{location}/cmekConfigs/{cmek_config}*\x0b\x63mekConfigs2\ncmekConfig\"|\n\x18UpdateCmekConfigMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x16ListCmekConfigsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Location\"\\\n\x17ListCmekConfigsResponse\x12\x41\n\x0c\x63mek_configs\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfig\"Z\n\x17\x44\x65leteCmekConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfig\"|\n\x18\x44\x65leteCmekConfigMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x81\t\n\x11\x43mekConfigService\x12\xe5\x02\n\x10UpdateCmekConfig\x12\x38.google.cloud.discoveryengine.v1.UpdateCmekConfigRequest\x1a\x1d.google.longrunning.Operation\"\xf7\x01\xca\x41\x66\n*google.cloud.discoveryengine.v1.CmekConfig\x12\x38google.cloud.discoveryengine.v1.UpdateCmekConfigMetadata\xda\x41\x06\x63onfig\x82\xd3\xe4\x93\x02\x7f\x32\x33/v1/{config.name=projects/*/locations/*/cmekConfig}:\x06\x63onfigZ@26/v1/{config.name=projects/*/locations/*/cmekConfigs/*}:\x06\x63onfig\x12\xe3\x01\n\rGetCmekConfig\x12\x35.google.cloud.discoveryengine.v1.GetCmekConfigRequest\x1a+.google.cloud.discoveryengine.v1.CmekConfig\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12,/v1/{name=projects/*/locations/*/cmekConfig}Z1\x12//v1/{name=projects/*/locations/*/cmekConfigs/*}\x12\xc6\x01\n\x0fListCmekConfigs\x12\x37.google.cloud.discoveryengine.v1.ListCmekConfigsRequest\x1a\x38.google.cloud.discoveryengine.v1.ListCmekConfigsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/cmekConfigs\x12\x80\x02\n\x10\x44\x65leteCmekConfig\x12\x38.google.cloud.discoveryengine.v1.DeleteCmekConfigRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41Q\n\x15google.protobuf.Empty\x12\x38google.cloud.discoveryengine.v1.DeleteCmekConfigMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/cmekConfigs/*}\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43mekConfigServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + UpdateCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateCmekConfigRequest").msgclass + GetCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetCmekConfigRequest").msgclass + SingleRegionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SingleRegionKey").msgclass + CmekConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig").msgclass + CmekConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig.State").enummodule + CmekConfig::NotebookLMState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig.NotebookLMState").enummodule + UpdateCmekConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateCmekConfigMetadata").msgclass + ListCmekConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCmekConfigsRequest").msgclass + ListCmekConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCmekConfigsResponse").msgclass + DeleteCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteCmekConfigRequest").msgclass + DeleteCmekConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteCmekConfigMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb new file mode 100644 index 000000000000..0cc0e58b4fd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/cmek_config_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CmekConfigService + # Service for managing CMEK related tasks + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.CmekConfigService' + + # Provisions a CMEK key for use in a location of a customer's project. + # This method will also conduct location validation on the provided + # cmekConfig to make sure the key is valid and can be used in the + # selected location. + rpc :UpdateCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Google::Longrunning::Operation + # Gets the [CmekConfig][google.cloud.discoveryengine.v1.CmekConfig]. + rpc :GetCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Google::Cloud::DiscoveryEngine::V1::CmekConfig + # Lists all the [CmekConfig][google.cloud.discoveryengine.v1.CmekConfig]s + # with the project. + rpc :ListCmekConfigs, ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse + # De-provisions a CmekConfig. + rpc :DeleteCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb new file mode 100644 index 000000000000..f319917117f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n,google/cloud/discoveryengine/v1/common.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"x\n\x08Interval\x12\x11\n\x07minimum\x18\x01 \x01(\x01H\x00\x12\x1b\n\x11\x65xclusive_minimum\x18\x02 \x01(\x01H\x00\x12\x11\n\x07maximum\x18\x03 \x01(\x01H\x01\x12\x1b\n\x11\x65xclusive_maximum\x18\x04 \x01(\x01H\x01\x42\x05\n\x03minB\x05\n\x03max\"0\n\x0f\x43ustomAttribute\x12\x0c\n\x04text\x18\x01 \x03(\t\x12\x0f\n\x07numbers\x18\x02 \x03(\x01\"G\n\x08UserInfo\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\nuser_agent\x18\x02 \x01(\t\x12\x16\n\ttime_zone\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x1c\n\nDoubleList\x12\x0e\n\x06values\x18\x01 \x03(\x01\"]\n\tPrincipal\x12\x11\n\x07user_id\x18\x01 \x01(\tH\x00\x12\x12\n\x08group_id\x18\x02 \x01(\tH\x00\x12\x1c\n\x12\x65xternal_entity_id\x18\x03 \x01(\tH\x00\x42\x0b\n\tprincipal\"n\n\x14HealthcareFhirConfig\x12\"\n\x1a\x65nable_configurable_schema\x18\x01 \x01(\x08\x12\x32\n*enable_static_indexing_for_batch_ingestion\x18\x02 \x01(\x08\"\xc6\x01\n\x13SearchLinkPromotion\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x08\x64ocument\x18\x06 \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x65nabled\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01*b\n\x10IndustryVertical\x12!\n\x1dINDUSTRY_VERTICAL_UNSPECIFIED\x10\x00\x12\x0b\n\x07GENERIC\x10\x01\x12\t\n\x05MEDIA\x10\x02\x12\x13\n\x0fHEALTHCARE_FHIR\x10\x07*\xa4\x01\n\x0cSolutionType\x12\x1d\n\x19SOLUTION_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cSOLUTION_TYPE_RECOMMENDATION\x10\x01\x12\x18\n\x14SOLUTION_TYPE_SEARCH\x10\x02\x12\x16\n\x12SOLUTION_TYPE_CHAT\x10\x03\x12!\n\x1dSOLUTION_TYPE_GENERATIVE_CHAT\x10\x04*h\n\rSearchUseCase\x12\x1f\n\x1bSEARCH_USE_CASE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SEARCH_USE_CASE_SEARCH\x10\x01\x12\x1a\n\x16SEARCH_USE_CASE_BROWSE\x10\x02*_\n\nSearchTier\x12\x1b\n\x17SEARCH_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SEARCH_TIER_STANDARD\x10\x01\x12\x1a\n\x16SEARCH_TIER_ENTERPRISE\x10\x02*C\n\x0bSearchAddOn\x12\x1d\n\x19SEARCH_ADD_ON_UNSPECIFIED\x10\x00\x12\x15\n\x11SEARCH_ADD_ON_LLM\x10\x01\x42\xda\r\n#com.google.cloud.discoveryengine.v1B\x0b\x43ommonProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1\xea\x41\xe6\x01\n%discoveryengine.googleapis.com/Branch\x12Qprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}\x12jprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}\xea\x41m\n)discoveryengine.googleapis.com/Collection\x12@projects/{project}/locations/{location}/collections/{collection}\xea\x41R\n\'discoveryengine.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41}\n.discoveryengine.googleapis.com/GroundingConfig\x12Kprojects/{project}/locations/{location}/groundingConfigs/{grounding_config}\xea\x41w\n,discoveryengine.googleapis.com/RankingConfig\x12Gprojects/{project}/locations/{location}/rankingConfigs/{ranking_config}\xea\x41w\n,discoveryengine.googleapis.com/LicenseConfig\x12Gprojects/{project}/locations/{location}/licenseConfigs/{license_config}\xea\x41k\n(discoveryengine.googleapis.com/UserStore\x12?projects/{project}/locations/{location}/userStores/{user_store}\xea\x41y\n#healthcare.googleapis.com/FhirStore\x12Rprojects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}\xea\x41\xa4\x01\n&healthcare.googleapis.com/FhirResource\x12zprojects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}\xea\x41y\n\"cloudkms.googleapis.com/CryptoKeys\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa7\x01\n)cloudkms.googleapis.com/CryptoKeyVersions\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Interval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Interval").msgclass + CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomAttribute").msgclass + UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserInfo").msgclass + DoubleList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DoubleList").msgclass + Principal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Principal").msgclass + HealthcareFhirConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.HealthcareFhirConfig").msgclass + SearchLinkPromotion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchLinkPromotion").msgclass + IndustryVertical = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.IndustryVertical").enummodule + SolutionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SolutionType").enummodule + SearchUseCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchUseCase").enummodule + SearchTier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchTier").enummodule + SearchAddOn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchAddOn").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb new file mode 100644 index 000000000000..bfe378e7a8b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/completion.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n0google/cloud/discoveryengine/v1/completion.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\"\xe9\x01\n\x17SuggestionDenyListEntry\x12\x19\n\x0c\x62lock_phrase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x63\n\x0ematch_operator\x18\x02 \x01(\x0e\x32\x46.google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperatorB\x03\xe0\x41\x02\"N\n\rMatchOperator\x12\x1e\n\x1aMATCH_OPERATOR_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45XACT_MATCH\x10\x01\x12\x0c\n\x08\x43ONTAINS\x10\x02\"\xc7\x01\n\x14\x43ompletionSuggestion\x12\x16\n\x0cglobal_score\x18\x02 \x01(\x01H\x00\x12\x13\n\tfrequency\x18\x03 \x01(\x03H\x00\x12\x17\n\nsuggestion\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12\x10\n\x08group_id\x18\x05 \x01(\t\x12\x13\n\x0bgroup_score\x18\x06 \x01(\x01\x12\x1b\n\x13\x61lternative_phrases\x18\x07 \x03(\tB\x0e\n\x0cranking_infoB\x82\x02\n#com.google.cloud.discoveryengine.v1B\x0f\x43ompletionProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + SuggestionDenyListEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SuggestionDenyListEntry").msgclass + SuggestionDenyListEntry::MatchOperator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperator").enummodule + CompletionSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompletionSuggestion").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb new file mode 100644 index 000000000000..5896c1b91e3a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/completion_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/import_config_pb' +require 'google/cloud/discoveryengine/v1/purge_config_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n8google/cloud/discoveryengine/v1/completion_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a#google/longrunning/operations.proto\"\xbf\x01\n\x14\x43ompleteQueryRequest\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0bquery_model\x18\x03 \x01(\t\x12\x16\n\x0euser_pseudo_id\x18\x04 \x01(\t\x12 \n\x18include_tail_suggestions\x18\x05 \x01(\x08\"\xe0\x01\n\x15\x43ompleteQueryResponse\x12\x61\n\x11query_suggestions\x18\x01 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion\x12\x1c\n\x14tail_match_triggered\x18\x02 \x01(\x08\x1a\x46\n\x0fQuerySuggestion\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12\x1f\n\x17\x63ompletable_field_paths\x18\x02 \x03(\t2\xef\x11\n\x11\x43ompletionService\x12\xa0\x02\n\rCompleteQuery\x12\x35.google.cloud.discoveryengine.v1.CompleteQueryRequest\x1a\x36.google.cloud.discoveryengine.v1.CompleteQueryResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12\x42/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQueryZR\x12P/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery\x12\xe5\x03\n\x1fImportSuggestionDenyListEntries\x12G.google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x02\xca\x41\x92\x01\nGgoogle.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesResponse\x12Ggoogle.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesMetadata\x82\xd3\xe4\x93\x02\xbc\x01\"_/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:import:\x01*ZV\"Q/v1/{parent=projects/*/locations/*/dataStores/*}/suggestionDenyListEntries:import:\x01*\x12\xe0\x03\n\x1ePurgeSuggestionDenyListEntries\x12\x46.google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\x90\x01\nFgoogle.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse\x12\x46google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata\x82\xd3\xe4\x93\x02\xbb\x01\"^/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:purge:\x01*ZV\"Q/v1/{parent=projects/*/locations/*/dataStores/**}/suggestionDenyListEntries:purge:\x01*\x12\xcd\x03\n\x1bImportCompletionSuggestions\x12\x43.google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x02\xca\x41\x8a\x01\nCgoogle.cloud.discoveryengine.v1.ImportCompletionSuggestionsResponse\x12\x43google.cloud.discoveryengine.v1.ImportCompletionSuggestionsMetadata\x82\xd3\xe4\x93\x02\xb4\x01\"[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:import:\x01*ZR\"M/v1/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:import:\x01*\x12\xc7\x03\n\x1aPurgeCompletionSuggestions\x12\x42.google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x02\xca\x41\x88\x01\nBgoogle.cloud.discoveryengine.v1.PurgeCompletionSuggestionsResponse\x12\x42google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsMetadata\x82\xd3\xe4\x93\x02\xb2\x01\"Z/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:purge:\x01*ZQ\"L/v1/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:purge:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43ompletionServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryRequest").msgclass + CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse").msgclass + CompleteQueryResponse::QuerySuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb new file mode 100644 index 000000000000..bf4e20e07088 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/completion_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/completion_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module CompletionService + # Service for Auto-Completion. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.CompletionService' + + # Completes the specified user input with keyword suggestions. + rpc :CompleteQuery, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse + # Imports all + # [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry] + # for a DataStore. + rpc :ImportSuggestionDenyListEntries, ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Google::Longrunning::Operation + # Permanently deletes all + # [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry] + # for a DataStore. + rpc :PurgeSuggestionDenyListEntries, ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Google::Longrunning::Operation + # Imports + # [CompletionSuggestion][google.cloud.discoveryengine.v1.CompletionSuggestion]s + # for a DataStore. + rpc :ImportCompletionSuggestions, ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Google::Longrunning::Operation + # Permanently deletes all + # [CompletionSuggestion][google.cloud.discoveryengine.v1.CompletionSuggestion]s + # for a DataStore. + rpc :PurgeCompletionSuggestions, ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb new file mode 100644 index 000000000000..bf4bde59cc6e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/control.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/discoveryengine/v1/control.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x02\n\tCondition\x12I\n\x0bquery_terms\x18\x02 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.Condition.QueryTerm\x12O\n\x11\x61\x63tive_time_range\x18\x03 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.Condition.TimeRange\x12\x18\n\x0bquery_regex\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a.\n\tQueryTerm\x12\r\n\x05value\x18\x01 \x01(\t\x12\x12\n\nfull_match\x18\x02 \x01(\x08\x1ai\n\tTimeRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb8\x12\n\x07\x43ontrol\x12L\n\x0c\x62oost_action\x18\x06 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Control.BoostActionH\x00\x12N\n\rfilter_action\x18\x07 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.Control.FilterActionH\x00\x12R\n\x0fredirect_action\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Control.RedirectActionH\x00\x12R\n\x0fsynonyms_action\x18\n \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Control.SynonymsActionH\x00\x12P\n\x0epromote_action\x18\x0f \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.Control.PromoteActionH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12*\n\x1d\x61ssociated_serving_config_ids\x18\x03 \x03(\tB\x03\xe0\x41\x03\x12L\n\rsolution_type\x18\x04 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x41\n\tuse_cases\x18\x08 \x03(\x0e\x32..google.cloud.discoveryengine.v1.SearchUseCase\x12>\n\nconditions\x18\x05 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.Condition\x1a\x9b\x07\n\x0b\x42oostAction\x12\x1a\n\x0b\x66ixed_boost\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x12t\n\x18interpolation_boost_spec\x18\x05 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpecB\x03\xe0\x41\x01H\x00\x12\x11\n\x05\x62oost\x18\x01 \x01(\x02\x42\x02\x18\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\ndata_store\x18\x03 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a\xfd\x04\n\x16InterpolationBoostSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12v\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Y.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.AttributeTypeB\x03\xe0\x41\x01\x12~\n\x12interpolation_type\x18\x03 \x01(\x0e\x32].google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.InterpolationTypeB\x03\xe0\x41\x01\x12u\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32X.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.ControlPointB\x03\xe0\x41\x01\x1aG\n\x0c\x43ontrolPoint\x12\x1c\n\x0f\x61ttribute_value\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x62oost_amount\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x42\x0c\n\nboost_spec\x1ai\n\x0c\x46ilterAction\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\ndata_store\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a+\n\x0eRedirectAction\x12\x19\n\x0credirect_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\"\n\x0eSynonymsAction\x12\x10\n\x08synonyms\x18\x01 \x03(\t\x1a\xaf\x01\n\rPromoteAction\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12X\n\x15search_link_promotion\x18\x02 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotionB\x03\xe0\x41\x02:\xd3\x02\xea\x41\xcf\x02\n&discoveryengine.googleapis.com/Control\x12Rprojects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}\x12kprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}\x12\x64projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}B\x08\n\x06\x61\x63tionB\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0c\x43ontrolProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.SearchLinkPromotion", "google/cloud/discoveryengine/v1/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition").msgclass + Condition::QueryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition.QueryTerm").msgclass + Condition::TimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition.TimeRange").msgclass + Control = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control").msgclass + Control::BoostAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction").msgclass + Control::BoostAction::InterpolationBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec").msgclass + Control::BoostAction::InterpolationBoostSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.ControlPoint").msgclass + Control::BoostAction::InterpolationBoostSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.AttributeType").enummodule + Control::BoostAction::InterpolationBoostSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.InterpolationType").enummodule + Control::FilterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.FilterAction").msgclass + Control::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.RedirectAction").msgclass + Control::SynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.SynonymsAction").msgclass + Control::PromoteAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.PromoteAction").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb new file mode 100644 index 000000000000..dfa16266f351 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/control_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/control_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n5google/cloud/discoveryengine/v1/control_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/discoveryengine/v1/control.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xaf\x01\n\x14\x43reateControlRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&discoveryengine.googleapis.com/Control\x12>\n\x07\x63ontrol\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.ControlB\x03\xe0\x41\x02\x12\x17\n\ncontrol_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x8c\x01\n\x14UpdateControlRequest\x12>\n\x07\x63ontrol\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.ControlB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"T\n\x14\x44\x65leteControlRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Control\"Q\n\x11GetControlRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Control\"\x9b\x01\n\x13ListControlsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&discoveryengine.googleapis.com/Control\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"k\n\x14ListControlsResponse\x12:\n\x08\x63ontrols\x18\x01 \x03(\x0b\x32(.google.cloud.discoveryengine.v1.Control\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe5\x0e\n\x0e\x43ontrolService\x12\xff\x02\n\rCreateControl\x12\x35.google.cloud.discoveryengine.v1.CreateControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\x8c\x02\xda\x41\x19parent,control,control_id\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/controls:\x07\x63ontrolZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls:\x07\x63ontrolZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls:\x07\x63ontrol\x12\xbd\x02\n\rDeleteControl\x12\x35.google.cloud.discoveryengine.v1.DeleteControlRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}\x12\x91\x03\n\rUpdateControl\x12\x35.google.cloud.discoveryengine.v1.UpdateControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\x9e\x02\xda\x41\x13\x63ontrol,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{control.name=projects/*/locations/*/dataStores/*/controls/*}:\x07\x63ontrolZZ2O/v1/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}:\x07\x63ontrolZW2L/v1/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}:\x07\x63ontrol\x12\xc9\x02\n\nGetControl\x12\x32.google.cloud.discoveryengine.v1.GetControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}\x12\xdc\x02\n\x0cListControls\x12\x34.google.cloud.discoveryengine.v1.ListControlsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListControlsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/controlsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controlsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13\x43ontrolServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.Control", "google/cloud/discoveryengine/v1/control.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + CreateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateControlRequest").msgclass + UpdateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateControlRequest").msgclass + DeleteControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteControlRequest").msgclass + GetControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetControlRequest").msgclass + ListControlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListControlsRequest").msgclass + ListControlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListControlsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb new file mode 100644 index 000000000000..9cbd2d3cb5e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb @@ -0,0 +1,69 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/control_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/control_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ControlService + # Service for performing CRUD operations on Controls. + # Controls allow for custom logic to be implemented in the serving path. + # Controls need to be attached to a Serving Config to be considered during a + # request. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.ControlService' + + # Creates a Control. + # + # By default 1000 controls are allowed for a data store. + # A request can be submitted to adjust this limit. + # If the [Control][google.cloud.discoveryengine.v1.Control] to create already + # exists, an ALREADY_EXISTS error is returned. + rpc :CreateControl, ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control + # Deletes a Control. + # + # If the [Control][google.cloud.discoveryengine.v1.Control] to delete does + # not exist, a NOT_FOUND error is returned. + rpc :DeleteControl, ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Google::Protobuf::Empty + # Updates a Control. + # + # [Control][google.cloud.discoveryengine.v1.Control] action type cannot be + # changed. If the [Control][google.cloud.discoveryengine.v1.Control] to + # update does not exist, a NOT_FOUND error is returned. + rpc :UpdateControl, ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control + # Gets a Control. + rpc :GetControl, ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control + # Lists all Controls by their parent + # [DataStore][google.cloud.discoveryengine.v1.DataStore]. + rpc :ListControls, ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb new file mode 100644 index 000000000000..df47999f1444 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/conversation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/search_service_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/discoveryengine/v1/conversation.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x05\n\x0c\x43onversation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32\x33.google.cloud.discoveryengine.v1.Conversation.State\x12\x16\n\x0euser_pseudo_id\x18\x03 \x01(\t\x12\x46\n\x08messages\x18\x04 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.ConversationMessage\x12\x33\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\">\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02:\xf6\x02\xea\x41\xf2\x02\n+discoveryengine.googleapis.com/Conversation\x12\\projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}\x12uprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}\x12nprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}\"Q\n\x05Reply\x12H\n\x07summary\x18\x03 \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\"I\n\x13\x43onversationContext\x12\x19\n\x11\x63ontext_documents\x18\x01 \x03(\t\x12\x17\n\x0f\x61\x63tive_document\x18\x02 \x01(\t\"a\n\tTextInput\x12\r\n\x05input\x18\x01 \x01(\t\x12\x45\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.ConversationContext\"\xd1\x01\n\x13\x43onversationMessage\x12@\n\nuser_input\x18\x01 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.TextInputH\x00\x12\x37\n\x05reply\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.ReplyH\x00\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\t\n\x07messageB\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11\x43onversationProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.SearchResponse.Summary", "google/cloud/discoveryengine/v1/search_service.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Conversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Conversation").msgclass + Conversation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Conversation.State").enummodule + Reply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Reply").msgclass + ConversationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConversationContext").msgclass + TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TextInput").msgclass + ConversationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConversationMessage").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb new file mode 100644 index 000000000000..dd9d20a907d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/conversational_search_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/answer_pb' +require 'google/cloud/discoveryengine/v1/conversation_pb' +require 'google/cloud/discoveryengine/v1/safety_pb' +require 'google/cloud/discoveryengine/v1/search_service_pb' +require 'google/cloud/discoveryengine/v1/session_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nCgoogle/cloud/discoveryengine/v1/conversational_search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/answer.proto\x1a\x32google/cloud/discoveryengine/v1/conversation.proto\x1a,google/cloud/discoveryengine/v1/safety.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9d\x05\n\x1b\x43onverseConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\x12>\n\x05query\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.TextInputB\x03\xe0\x41\x02\x12I\n\x0eserving_config\x18\x03 \x01(\tB1\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12\x43\n\x0c\x63onversation\x18\x05 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12\x13\n\x0bsafe_search\x18\x06 \x01(\x08\x12\x61\n\x0buser_labels\x18\x07 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.ConverseConversationRequest.UserLabelsEntry\x12\x62\n\x0csummary_spec\x18\x08 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12\x0e\n\x06\x66ilter\x18\t \x01(\t\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf0\x01\n\x1c\x43onverseConversationResponse\x12\x35\n\x05reply\x18\x01 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Reply\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12T\n\x0esearch_results\x18\x03 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\"\xa7\x01\n\x19\x43reateConversationRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.ConversationB\x03\xe0\x41\x02\"\x96\x01\n\x19UpdateConversationRequest\x12H\n\x0c\x63onversation\x18\x01 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.ConversationB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x19\x44\x65leteConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\"[\n\x16GetConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\"\xa5\x01\n\x18ListConversationsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"z\n\x19ListConversationsResponse\x12\x44\n\rconversations\x18\x01 \x03(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8b\x30\n\x12\x41nswerQueryRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x05query\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.QueryB\x03\xe0\x41\x02\x12<\n\x07session\x18\x03 \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12S\n\x0bsafety_spec\x18\x04 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec\x12h\n\x16related_questions_spec\x18\x05 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec\x12^\n\x0egrounding_spec\x18\x06 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpecB\x03\xe0\x41\x01\x12h\n\x16\x61nswer_generation_spec\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec\x12S\n\x0bsearch_spec\x18\x08 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec\x12l\n\x18query_understanding_spec\x18\t \x01(\x0b\x32J.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec\x12\x1d\n\x11\x61synchronous_mode\x18\n \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0euser_pseudo_id\x18\x0c \x01(\t\x12X\n\x0buser_labels\x18\r \x03(\x0b\x32\x43.google.cloud.discoveryengine.v1.AnswerQueryRequest.UserLabelsEntry\x12[\n\rend_user_spec\x18\x0e \x01(\x0b\x32?.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpecB\x03\xe0\x41\x01\x1a\xf9\x03\n\nSafetySpec\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\x12j\n\x0fsafety_settings\x18\x02 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySettingB\x03\xe0\x41\x01\x1a\xee\x02\n\rSafetySetting\x12\x44\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.HarmCategoryB\x03\xe0\x41\x02\x12w\n\tthreshold\x18\x02 \x01(\x0e\x32_.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting.HarmBlockThresholdB\x03\xe0\x41\x02\"\x9d\x01\n\x12HarmBlockThreshold\x12$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42LOCK_LOW_AND_ABOVE\x10\x01\x12\x1a\n\x16\x42LOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\n\x0f\x42LOCK_ONLY_HIGH\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04\x12\x07\n\x03OFF\x10\x05\x1a&\n\x14RelatedQuestionsSpec\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\x1a\x8e\x02\n\rGroundingSpec\x12\'\n\x1ainclude_grounding_supports\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12n\n\x0f\x66iltering_level\x18\x03 \x01(\x0e\x32P.google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec.FilteringLevelB\x03\xe0\x41\x01\"d\n\x0e\x46ilteringLevel\x12\x1f\n\x1b\x46ILTERING_LEVEL_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46ILTERING_LEVEL_LOW\x10\x01\x12\x18\n\x14\x46ILTERING_LEVEL_HIGH\x10\x02\x1a\xa3\x04\n\x14\x41nswerGenerationSpec\x12\x66\n\nmodel_spec\x18\x01 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec\x12h\n\x0bprompt_spec\x18\x02 \x01(\x0b\x32S.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec\x12\x19\n\x11include_citations\x18\x03 \x01(\x08\x12\x1c\n\x14\x61nswer_language_code\x18\x04 \x01(\t\x12 \n\x18ignore_adversarial_query\x18\x05 \x01(\x08\x12\'\n\x1fignore_non_answer_seeking_query\x18\x06 \x01(\x08\x12(\n\x1bignore_low_relevant_content\x18\x07 \x01(\x08H\x00\x88\x01\x01\x12\'\n\x1aignore_jail_breaking_query\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x1a\"\n\tModelSpec\x12\x15\n\rmodel_version\x18\x01 \x01(\t\x1a\x1e\n\nPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\tB\x1e\n\x1c_ignore_low_relevant_content\x1a\xd8\x10\n\nSearchSpec\x12\x64\n\rsearch_params\x18\x01 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParamsH\x00\x12m\n\x12search_result_list\x18\x02 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultListH\x00\x1a\xe1\x02\n\x0cSearchParams\x12\x1a\n\x12max_return_results\x18\x01 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12L\n\nboost_spec\x18\x03 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12m\n\x12search_result_mode\x18\x05 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12V\n\x10\x64\x61ta_store_specs\x18\x07 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x1a\x87\x0c\n\x10SearchResultList\x12t\n\x0esearch_results\x18\x01 \x03(\x0b\x32\\.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult\x1a\xfc\n\n\x0cSearchResult\x12\x9b\x01\n\x1aunstructured_document_info\x18\x01 \x01(\x0b\x32u.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfoH\x00\x12|\n\nchunk_info\x18\x02 \x01(\x0b\x32\x66.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfoH\x00\x1a\xa6\x06\n\x18UnstructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\xa1\x01\n\x11\x64ocument_contexts\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext\x12\xa5\x01\n\x13\x65xtractive_segments\x18\x05 \x03(\x0b\x32\x87\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment\x12\xa7\x01\n\x12\x65xtractive_answers\x18\x06 \x03(\x0b\x32\x86\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswerB\x02\x18\x01\x1a;\n\x0f\x44ocumentContext\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a=\n\x11\x45xtractiveSegment\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a<\n\x10\x45xtractiveAnswer\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x9b\x02\n\tChunkInfo\x12\x38\n\x05\x63hunk\x18\x01 \x01(\tB)\xfa\x41&\n$discoveryengine.googleapis.com/Chunk\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x92\x01\n\x11\x64ocument_metadata\x18\x04 \x01(\x0b\x32w.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata\x1a.\n\x10\x44ocumentMetadata\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\tB\t\n\x07\x63ontentB\x07\n\x05input\x1a\xae\x08\n\x16QueryUnderstandingSpec\x12\x85\x01\n\x19query_classification_spec\x18\x01 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec\x12{\n\x14query_rephraser_spec\x18\x02 \x01(\x0b\x32].google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec\x12%\n\x18\x64isable_spell_correction\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xc6\x02\n\x17QueryClassificationSpec\x12v\n\x05types\x18\x01 \x03(\x0e\x32g.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type\"\xb2\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44VERSARIAL_QUERY\x10\x01\x12\x1c\n\x18NON_ANSWER_SEEKING_QUERY\x10\x02\x12\x17\n\x13JAIL_BREAKING_QUERY\x10\x03\x12\x1f\n\x1bNON_ANSWER_SEEKING_QUERY_V2\x10\x04\x12%\n!USER_DEFINED_CLASSIFICATION_QUERY\x10\x05\x1a\x9e\x03\n\x12QueryRephraserSpec\x12\x0f\n\x07\x64isable\x18\x01 \x01(\x08\x12\x1a\n\x12max_rephrase_steps\x18\x02 \x01(\x05\x12\x80\x01\n\nmodel_spec\x18\x03 \x01(\x0b\x32g.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpecB\x03\xe0\x41\x01\x1a\xd7\x01\n\tModelSpec\x12\x8a\x01\n\nmodel_type\x18\x01 \x01(\x0e\x32q.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec.ModelTypeB\x03\xe0\x41\x01\"=\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SMALL\x10\x01\x12\t\n\x05LARGE\x10\x02\x1a\xd8\x03\n\x0b\x45ndUserSpec\x12o\n\x11\x65nd_user_metadata\x18\x01 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaDataB\x03\xe0\x41\x01\x1a\xd7\x02\n\x0f\x45ndUserMetaData\x12o\n\nchunk_info\x18\x01 \x01(\x0b\x32Y.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfoH\x00\x1a\xc7\x01\n\tChunkInfo\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x85\x01\n\x11\x64ocument_metadata\x18\x02 \x01(\x0b\x32j.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo.DocumentMetadata\x1a!\n\x10\x44ocumentMetadata\x12\r\n\x05title\x18\x01 \x01(\tB\t\n\x07\x63ontent\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa5\x01\n\x13\x41nswerQueryResponse\x12\x37\n\x06\x61nswer\x18\x01 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Answer\x12\x39\n\x07session\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.Session\x12\x1a\n\x12\x61nswer_query_token\x18\x03 \x01(\t\"O\n\x10GetAnswerRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Answer\"\x98\x01\n\x14\x43reateSessionRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12>\n\x07session\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SessionB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateSessionRequest\x12>\n\x07session\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SessionB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"T\n\x14\x44\x65leteSessionRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Session\"v\n\x11GetSessionRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12#\n\x16include_answer_details\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xa0\x01\n\x13ListSessionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"k\n\x14ListSessionsResponse\x12:\n\x08sessions\x18\x01 \x03(\x0b\x32(.google.cloud.discoveryengine.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x96+\n\x1b\x43onversationalSearchService\x12\xab\x03\n\x14\x43onverseConversation\x12<.google.cloud.discoveryengine.v1.ConverseConversationRequest\x1a=.google.cloud.discoveryengine.v1.ConverseConversationResponse\"\x95\x02\xda\x41\nname,query\x82\xd3\xe4\x93\x02\x81\x02\"G/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse:\x01*ZZ\"U/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse:\x01*ZW\"R/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}:converse:\x01*\x12\xa6\x03\n\x12\x43reateConversation\x12:.google.cloud.discoveryengine.v1.CreateConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xa4\x02\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02\x87\x02\">/v1/{parent=projects/*/locations/*/dataStores/*}/conversations:\x0c\x63onversationZ\\\"L/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations:\x0c\x63onversationZY\"I/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations:\x0c\x63onversation\x12\xd6\x02\n\x12\x44\x65leteConversation\x12:.google.cloud.discoveryengine.v1.DeleteConversationRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*>/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}ZN*L/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}ZK*I/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}\x12\xd2\x03\n\x12UpdateConversation\x12:.google.cloud.discoveryengine.v1.UpdateConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xd0\x02\xda\x41\x18\x63onversation,update_mask\x82\xd3\xe4\x93\x02\xae\x02\x32K/v1/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}:\x0c\x63onversationZi2Y/v1/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:\x0c\x63onversationZf2V/v1/{conversation.name=projects/*/locations/*/collections/*/engines/*/conversations/*}:\x0c\x63onversation\x12\xe7\x02\n\x0fGetConversation\x12\x37.google.cloud.discoveryengine.v1.GetConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12>/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}ZN\x12L/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}ZK\x12I/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}\x12\xfa\x02\n\x11ListConversations\x12\x39.google.cloud.discoveryengine.v1.ListConversationsRequest\x1a:.google.cloud.discoveryengine.v1.ListConversationsResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12>/v1/{parent=projects/*/locations/*/dataStores/*}/conversationsZN\x12L/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversationsZK\x12I/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations\x12\x9e\x03\n\x0b\x41nswerQuery\x12\x33.google.cloud.discoveryengine.v1.AnswerQueryRequest\x1a\x34.google.cloud.discoveryengine.v1.AnswerQueryResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:answer:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:answer:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:answer:\x01*\x12\xb8\x03\n\x11StreamAnswerQuery\x12\x33.google.cloud.discoveryengine.v1.AnswerQueryRequest\x1a\x34.google.cloud.discoveryengine.v1.AnswerQueryResponse\"\xb5\x02\x82\xd3\xe4\x93\x02\xae\x02\"V/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:streamAnswer:\x01*Zi\"d/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:streamAnswer:\x01*Zf\"a/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:streamAnswer:\x01*0\x01\x12\xe4\x02\n\tGetAnswer\x12\x31.google.cloud.discoveryengine.v1.GetAnswerRequest\x1a\'.google.cloud.discoveryengine.v1.Answer\"\xfa\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xec\x01\x12\x43/v1/{name=projects/*/locations/*/dataStores/*/sessions/*/answers/*}ZS\x12Q/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*/answers/*}ZP\x12N/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*/answers/*}\x12\xf4\x02\n\rCreateSession\x12\x35.google.cloud.discoveryengine.v1.CreateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x81\x02\xda\x41\x0eparent,session\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/sessions:\x07sessionZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions:\x07sessionZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions:\x07session\x12\xbd\x02\n\rDeleteSession\x12\x35.google.cloud.discoveryengine.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\x91\x03\n\rUpdateSession\x12\x35.google.cloud.discoveryengine.v1.UpdateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x9e\x02\xda\x41\x13session,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{session.name=projects/*/locations/*/dataStores/*/sessions/*}:\x07sessionZZ2O/v1/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}:\x07sessionZW2L/v1/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}:\x07session\x12\xc9\x02\n\nGetSession\x12\x32.google.cloud.discoveryengine.v1.GetSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\xdc\x02\n\x0cListSessions\x12\x34.google.cloud.discoveryengine.v1.ListSessionsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListSessionsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/sessionsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessionsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n#com.google.cloud.discoveryengine.v1B ConversationalSearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.TextInput", "google/cloud/discoveryengine/v1/conversation.proto"], + ["google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec", "google/cloud/discoveryengine/v1/search_service.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.discoveryengine.v1.Query", "google/cloud/discoveryengine/v1/session.proto"], + ["google.cloud.discoveryengine.v1.Answer", "google/cloud/discoveryengine/v1/answer.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + ConverseConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConverseConversationRequest").msgclass + ConverseConversationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConverseConversationResponse").msgclass + CreateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateConversationRequest").msgclass + UpdateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateConversationRequest").msgclass + DeleteConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteConversationRequest").msgclass + GetConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetConversationRequest").msgclass + ListConversationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListConversationsRequest").msgclass + ListConversationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListConversationsResponse").msgclass + AnswerQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest").msgclass + AnswerQueryRequest::SafetySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec").msgclass + AnswerQueryRequest::SafetySpec::SafetySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting").msgclass + AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting.HarmBlockThreshold").enummodule + AnswerQueryRequest::RelatedQuestionsSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec").msgclass + AnswerQueryRequest::GroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec").msgclass + AnswerQueryRequest::GroundingSpec::FilteringLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec.FilteringLevel").enummodule + AnswerQueryRequest::AnswerGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec").msgclass + AnswerQueryRequest::AnswerGenerationSpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec").msgclass + AnswerQueryRequest::AnswerGenerationSpec::PromptSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec").msgclass + AnswerQueryRequest::SearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec").msgclass + AnswerQueryRequest::SearchSpec::SearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo").msgclass + AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata").msgclass + AnswerQueryRequest::QueryUnderstandingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec").msgclass + AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec").msgclass + AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type").enummodule + AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec").msgclass + AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec").msgclass + AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec.ModelType").enummodule + AnswerQueryRequest::EndUserSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec").msgclass + AnswerQueryRequest::EndUserSpec::EndUserMetaData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData").msgclass + AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo").msgclass + AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo.DocumentMetadata").msgclass + AnswerQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryResponse").msgclass + GetAnswerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetAnswerRequest").msgclass + CreateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSessionRequest").msgclass + UpdateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateSessionRequest").msgclass + DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSessionRequest").msgclass + GetSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetSessionRequest").msgclass + ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListSessionsRequest").msgclass + ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListSessionsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb new file mode 100644 index 000000000000..cdc17b9d151c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb @@ -0,0 +1,100 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/conversational_search_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/conversational_search_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ConversationalSearchService + # Service for conversational search. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.ConversationalSearchService' + + # Converses a conversation. + rpc :ConverseConversation, ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse + # Creates a Conversation. + # + # If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to + # create already exists, an ALREADY_EXISTS error is returned. + rpc :CreateConversation, ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation + # Deletes a Conversation. + # + # If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to + # delete does not exist, a NOT_FOUND error is returned. + rpc :DeleteConversation, ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Google::Protobuf::Empty + # Updates a Conversation. + # + # [Conversation][google.cloud.discoveryengine.v1.Conversation] action type + # cannot be changed. If the + # [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does + # not exist, a NOT_FOUND error is returned. + rpc :UpdateConversation, ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation + # Gets a Conversation. + rpc :GetConversation, ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation + # Lists all Conversations by their parent + # [DataStore][google.cloud.discoveryengine.v1.DataStore]. + rpc :ListConversations, ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse + # Answer query method. + rpc :AnswerQuery, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse + # Answer query method (streaming). + # + # It takes one + # [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] + # and returns multiple + # [AnswerQueryResponse][google.cloud.discoveryengine.v1.AnswerQueryResponse] + # messages in a stream. + rpc :StreamAnswerQuery, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, stream(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse) + # Gets a Answer. + rpc :GetAnswer, ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Google::Cloud::DiscoveryEngine::V1::Answer + # Creates a Session. + # + # If the [Session][google.cloud.discoveryengine.v1.Session] to create already + # exists, an ALREADY_EXISTS error is returned. + rpc :CreateSession, ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Deletes a Session. + # + # If the [Session][google.cloud.discoveryengine.v1.Session] to delete does + # not exist, a NOT_FOUND error is returned. + rpc :DeleteSession, ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Google::Protobuf::Empty + # Updates a Session. + # + # [Session][google.cloud.discoveryengine.v1.Session] action type cannot be + # changed. If the [Session][google.cloud.discoveryengine.v1.Session] to + # update does not exist, a NOT_FOUND error is returned. + rpc :UpdateSession, ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Gets a Session. + rpc :GetSession, ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Lists all Sessions by their parent + # [DataStore][google.cloud.discoveryengine.v1.DataStore]. + rpc :ListSessions, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb new file mode 100644 index 000000000000..99d68865780f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/custom_tuning_model.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/discoveryengine/v1/custom_tuning_model.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcd\x07\n\x11\x43ustomTuningModel\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0discoveryengine.googleapis.com/CustomTuningModel\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rmodel_version\x18\x03 \x01(\x03\x12R\n\x0bmodel_state\x18\x04 \x01(\x0e\x32=.google.cloud.discoveryengine.v1.CustomTuningModel.ModelState\x12\x33\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x37\n\x13training_start_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12P\n\x07metrics\x18\x07 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.CustomTuningModel.MetricsEntry\x12\x15\n\rerror_message\x18\x08 \x01(\t\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xc0\x01\n\nModelState\x12\x1b\n\x17MODEL_STATE_UNSPECIFIED\x10\x00\x12\x13\n\x0fTRAINING_PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x12\x15\n\x11TRAINING_COMPLETE\x10\x03\x12\x15\n\x11READY_FOR_SERVING\x10\x04\x12\x13\n\x0fTRAINING_FAILED\x10\x05\x12\x12\n\x0eNO_IMPROVEMENT\x10\x06\x12\x1b\n\x17INPUT_VALIDATION_FAILED\x10\x07:\xa4\x02\xea\x41\xa0\x02\n0discoveryengine.googleapis.com/CustomTuningModel\x12hprojects/{project}/locations/{location}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}\x12\x81\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}B\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43ustomTuningModelProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + CustomTuningModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomTuningModel").msgclass + CustomTuningModel::ModelState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomTuningModel.ModelState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb new file mode 100644 index 000000000000..069619b9b2a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/data_store.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' +require 'google/cloud/discoveryengine/v1/common_pb' +require 'google/cloud/discoveryengine/v1/document_processing_config_pb' +require 'google/cloud/discoveryengine/v1/schema_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/discoveryengine/v1/data_store.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/cmek_config_service.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a@google/cloud/discoveryengine/v1/document_processing_config.proto\x1a,google/cloud/discoveryengine/v1/schema.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xec\x0e\n\tDataStore\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x05\x12\x45\n\x0esolution_types\x18\x05 \x03(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionType\x12\x1e\n\x11\x64\x65\x66\x61ult_schema_id\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12U\n\x0e\x63ontent_config\x18\x06 \x01(\x0e\x32\x38.google.cloud.discoveryengine.v1.DataStore.ContentConfigB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x1b\x61\x64vanced_site_search_config\x18\x0c \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AdvancedSiteSearchConfigB\x03\xe0\x41\x01\x12\x82\x01\n+natural_language_query_understanding_config\x18\" \x01(\x0b\x32H.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfigB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18 \x01(\tB\x03\xe0\x41\x04\x12\x45\n\x0b\x63mek_config\x18\x12 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x03\x12]\n\x12\x62illing_estimation\x18\x17 \x01(\x0b\x32<.google.cloud.discoveryengine.v1.DataStore.BillingEstimationB\x03\xe0\x41\x03\x12\x18\n\x0b\x61\x63l_enabled\x18\x18 \x01(\x08\x42\x03\xe0\x41\x05\x12J\n\x10workspace_config\x18\x19 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.WorkspaceConfig\x12]\n\x1a\x64ocument_processing_config\x18\x1b \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.DocumentProcessingConfig\x12@\n\x0fstarting_schema\x18\x1c \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Schema\x12Z\n\x16healthcare_fhir_config\x18\x1d \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.HealthcareFhirConfigB\x03\xe0\x41\x01\x12[\n\x16identity_mapping_store\x18\x1f \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3discoveryengine.googleapis.com/IdentityMappingStore\x1a\xae\x02\n\x11\x42illingEstimation\x12\x1c\n\x14structured_data_size\x18\x01 \x01(\x03\x12\x1e\n\x16unstructured_data_size\x18\x02 \x01(\x03\x12\x19\n\x11website_data_size\x18\x03 \x01(\x03\x12?\n\x1bstructured_data_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x1dunstructured_data_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x18website_data_update_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x7f\n\rContentConfig\x12\x1e\n\x1a\x43ONTENT_CONFIG_UNSPECIFIED\x10\x00\x12\x0e\n\nNO_CONTENT\x10\x01\x12\x14\n\x10\x43ONTENT_REQUIRED\x10\x02\x12\x12\n\x0ePUBLIC_WEBSITE\x10\x03\x12\x14\n\x10GOOGLE_WORKSPACE\x10\x04:\xc9\x01\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\"\x9e\x01\n\x18\x41\x64vancedSiteSearchConfig\x12\"\n\x15\x64isable_initial_index\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12&\n\x19\x64isable_automatic_refresh\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x18\n\x16_disable_initial_indexB\x1c\n\x1a_disable_automatic_refresh\"\xbf\x01\n\'NaturalLanguageQueryUnderstandingConfig\x12[\n\x04mode\x18\x01 \x01(\x0e\x32M.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"\xf5\x02\n\x0fWorkspaceConfig\x12\x43\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.WorkspaceConfig.Type\x12\x1a\n\x12\x64\x61sher_customer_id\x18\x02 \x01(\t\x12(\n\x1bsuper_admin_service_account\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19super_admin_email_address\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_DRIVE\x10\x01\x12\x0f\n\x0bGOOGLE_MAIL\x10\x02\x12\x10\n\x0cGOOGLE_SITES\x10\x03\x12\x13\n\x0fGOOGLE_CALENDAR\x10\x04\x12\x0f\n\x0bGOOGLE_CHAT\x10\x05\x12\x11\n\rGOOGLE_GROUPS\x10\x06\x12\x0f\n\x0bGOOGLE_KEEP\x10\x07\x12\x11\n\rGOOGLE_PEOPLE\x10\x08\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x44\x61taStoreProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.CmekConfig", "google/cloud/discoveryengine/v1/cmek_config_service.proto"], + ["google.cloud.discoveryengine.v1.DocumentProcessingConfig", "google/cloud/discoveryengine/v1/document_processing_config.proto"], + ["google.cloud.discoveryengine.v1.Schema", "google/cloud/discoveryengine/v1/schema.proto"], + ["google.cloud.discoveryengine.v1.HealthcareFhirConfig", "google/cloud/discoveryengine/v1/common.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + DataStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore").msgclass + DataStore::BillingEstimation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.BillingEstimation").msgclass + DataStore::ContentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.ContentConfig").enummodule + AdvancedSiteSearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AdvancedSiteSearchConfig").msgclass + NaturalLanguageQueryUnderstandingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig").msgclass + NaturalLanguageQueryUnderstandingConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode").enummodule + WorkspaceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig").msgclass + WorkspaceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb new file mode 100644 index 000000000000..2a40be456b65 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/data_store_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/data_store_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/discoveryengine/v1/data_store_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/discoveryengine/v1/data_store.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x02\n\x16\x43reateDataStoreRequest\x12J\n\x10\x63mek_config_name\x18\x05 \x01(\tB.\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfigH\x00\x12\x16\n\x0c\x64isable_cmek\x18\x06 \x01(\x08H\x00\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x43\n\ndata_store\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.DataStoreB\x03\xe0\x41\x02\x12\x1a\n\rdata_store_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12#\n\x1b\x63reate_advanced_site_search\x18\x04 \x01(\x08\x12$\n\x1cskip_default_schema_creation\x18\x07 \x01(\x08\x42\x0e\n\x0c\x63mek_options\"U\n\x13GetDataStoreRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"{\n\x17\x43reateDataStoreMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x91\x01\n\x15ListDataStoresRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"r\n\x16ListDataStoresResponse\x12?\n\x0b\x64\x61ta_stores\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.DataStore\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x16\x44\x65leteDataStoreRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"\x8e\x01\n\x16UpdateDataStoreRequest\x12\x43\n\ndata_store\x18\x01 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.DataStoreB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"{\n\x17\x44\x65leteDataStoreMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xdd\x0c\n\x10\x44\x61taStoreService\x12\x84\x03\n\x0f\x43reateDataStore\x12\x37.google.cloud.discoveryengine.v1.CreateDataStoreRequest\x1a\x1d.google.longrunning.Operation\"\x98\x02\xca\x41\x64\n)google.cloud.discoveryengine.v1.DataStore\x12\x37google.cloud.discoveryengine.v1.CreateDataStoreMetadata\xda\x41\x1fparent,data_store,data_store_id\x82\xd3\xe4\x93\x02\x88\x01\"./v1/{parent=projects/*/locations/*}/dataStores:\ndata_storeZJ\"\x12\x12*\n\nprincipals\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.Principal\x12\x10\n\x08idp_wide\x18\x02 \x01(\x08\x1a\x86\x01\n\x0bIndexStatus\x12.\n\nindex_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12\x1c\n\x0fpending_message\x18\x03 \x01(\tB\x03\xe0\x41\x05:\x96\x02\xea\x41\x92\x02\n\'discoveryengine.googleapis.com/Document\x12\x66projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}\x12\x7fprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}B\x06\n\x04\x64\x61taB\x80\x02\n#com.google.cloud.discoveryengine.v1B\rDocumentProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Struct", "google/protobuf/struct.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.Principal", "google/cloud/discoveryengine/v1/common.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document").msgclass + Document::Content = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.Content").msgclass + Document::AclInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.AclInfo").msgclass + Document::AclInfo::AccessRestriction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.AclInfo.AccessRestriction").msgclass + Document::IndexStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.IndexStatus").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb new file mode 100644 index 000000000000..da24f28e1803 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/document_processing_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n@google/cloud/discoveryengine/v1/document_processing_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x84\x0e\n\x18\x44ocumentProcessingConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x61\n\x0f\x63hunking_config\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig\x12g\n\x16\x64\x65\x66\x61ult_parsing_config\x18\x04 \x01(\x0b\x32G.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig\x12w\n\x18parsing_config_overrides\x18\x05 \x03(\x0b\x32U.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfigOverridesEntry\x1a\xff\x01\n\x0e\x43hunkingConfig\x12\x8a\x01\n\x1clayout_based_chunking_config\x18\x01 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig.LayoutBasedChunkingConfigH\x00\x1aR\n\x19LayoutBasedChunkingConfig\x12\x12\n\nchunk_size\x18\x01 \x01(\x05\x12!\n\x19include_ancestor_headings\x18\x02 \x01(\x08\x42\x0c\n\nchunk_mode\x1a\xfc\x05\n\rParsingConfig\x12~\n\x16\x64igital_parsing_config\x18\x01 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfigH\x00\x12v\n\x12ocr_parsing_config\x18\x02 \x01(\x0b\x32X.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfigH\x00\x12|\n\x15layout_parsing_config\x18\x03 \x01(\x0b\x32[.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.LayoutParsingConfigH\x00\x1a\x16\n\x14\x44igitalParsingConfig\x1aS\n\x10OcrParsingConfig\x12&\n\x1a\x65nhanced_document_elements\x18\x01 \x03(\tB\x02\x18\x01\x12\x17\n\x0fuse_native_text\x18\x02 \x01(\x08\x1a\xee\x01\n\x13LayoutParsingConfig\x12$\n\x17\x65nable_table_annotation\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12$\n\x17\x65nable_image_annotation\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12%\n\x18structured_content_types\x18\t \x03(\tB\x03\xe0\x41\x01\x12\"\n\x15\x65xclude_html_elements\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14\x65xclude_html_classes\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65xclude_html_ids\x18\x0c \x03(\tB\x03\xe0\x41\x01\x42\x17\n\x15type_dedicated_config\x1a\x86\x01\n\x1bParsingConfigOverridesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12V\n\x05value\x18\x02 \x01(\x0b\x32G.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig:\x02\x38\x01:\x8a\x02\xea\x41\x86\x02\n7discoveryengine.googleapis.com/DocumentProcessingConfig\x12Xprojects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig\x12qprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfigB\x90\x02\n#com.google.cloud.discoveryengine.v1B\x1d\x44ocumentProcessingConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + DocumentProcessingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig").msgclass + DocumentProcessingConfig::ChunkingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig").msgclass + DocumentProcessingConfig::ChunkingConfig::LayoutBasedChunkingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig.LayoutBasedChunkingConfig").msgclass + DocumentProcessingConfig::ParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig").msgclass + DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfig").msgclass + DocumentProcessingConfig::ParsingConfig::OcrParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfig").msgclass + DocumentProcessingConfig::ParsingConfig::LayoutParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.LayoutParsingConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb new file mode 100644 index 000000000000..91fa7896d220 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/document_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/document_pb' +require 'google/cloud/discoveryengine/v1/import_config_pb' +require 'google/cloud/discoveryengine/v1/purge_config_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n6google/cloud/discoveryengine/v1/document_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"S\n\x12GetDocumentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"|\n\x14ListDocumentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x15ListDocumentsResponse\x12<\n\tdocuments\x18\x01 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb2\x01\n\x15\x43reateDocumentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12@\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\x12\x18\n\x0b\x64ocument_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa1\x01\n\x15UpdateDocumentRequest\x12@\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\x12\x15\n\rallow_missing\x18\x02 \x01(\x08\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"V\n\x15\x44\x65leteDocumentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"\x9b\x04\n BatchGetDocumentsMetadataRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12_\n\x07matcher\x18\x02 \x01(\x0b\x32I.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.MatcherB\x03\xe0\x41\x02\x1a\x1b\n\x0bUrisMatcher\x12\x0c\n\x04uris\x18\x01 \x03(\t\x1aU\n\x0b\x46hirMatcher\x12\x46\n\x0e\x66hir_resources\x18\x01 \x03(\tB.\xe0\x41\x02\xfa\x41(\n&healthcare.googleapis.com/FhirResource\x1a\xe2\x01\n\x07Matcher\x12\x65\n\x0curis_matcher\x18\x01 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.UrisMatcherH\x00\x12\x65\n\x0c\x66hir_matcher\x18\x02 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcherH\x00\x42\t\n\x07matcher\"\xa0\x05\n!BatchGetDocumentsMetadataResponse\x12o\n\x12\x64ocuments_metadata\x18\x01 \x03(\x0b\x32S.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata\x1a\xb2\x03\n\x10\x44ocumentMetadata\x12w\n\rmatcher_value\x18\x02 \x01(\x0b\x32`.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata.MatcherValue\x12W\n\x05state\x18\x03 \x01(\x0e\x32H.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.State\x12\x37\n\x13last_refreshed_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1d\n\x15\x64\x61ta_ingestion_source\x18\x05 \x01(\t\x1at\n\x0cMatcherValue\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x44\n\rfhir_resource\x18\x02 \x01(\tB+\xfa\x41(\n&healthcare.googleapis.com/FhirResourceH\x00\x42\x0f\n\rmatcher_value\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INDEXED\x10\x01\x12\x16\n\x12NOT_IN_TARGET_SITE\x10\x02\x12\x10\n\x0cNOT_IN_INDEX\x10\x03\x32\x9d\x16\n\x0f\x44ocumentService\x12\x9c\x02\n\x0bGetDocument\x12\x33.google.cloud.discoveryengine.v1.GetDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01\x12\x45/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}ZU\x12S/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}\x12\xaf\x02\n\rListDocuments\x12\x35.google.cloud.discoveryengine.v1.ListDocumentsRequest\x1a\x36.google.cloud.discoveryengine.v1.ListDocumentsResponse\"\xae\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9e\x01\x12\x45/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documentsZU\x12S/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents\x12\xcd\x02\n\x0e\x43reateDocument\x12\x36.google.cloud.discoveryengine.v1.CreateDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xd7\x01\xda\x41\x1bparent,document,document_id\x82\xd3\xe4\x93\x02\xb2\x01\"E/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:\x08\x64ocumentZ_\"S/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:\x08\x64ocument\x12\xd8\x02\n\x0eUpdateDocument\x12\x36.google.cloud.discoveryengine.v1.UpdateDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xe2\x01\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\xc4\x01\x32N/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:\x08\x64ocumentZh2\\/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:\x08\x64ocument\x12\x8f\x02\n\x0e\x44\x65leteDocument\x12\x36.google.cloud.discoveryengine.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01*E/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}ZU*S/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}\x12\x9a\x03\n\x0fImportDocuments\x12\x37.google.cloud.discoveryengine.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xae\x02\xca\x41r\n7google.cloud.discoveryengine.v1.ImportDocumentsResponse\x12\x37google.cloud.discoveryengine.v1.ImportDocumentsMetadata\x82\xd3\xe4\x93\x02\xb2\x01\"L/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import:\x01*Z_\"Z/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import:\x01*\x12\x94\x03\n\x0ePurgeDocuments\x12\x36.google.cloud.discoveryengine.v1.PurgeDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xaa\x02\xca\x41p\n6google.cloud.discoveryengine.v1.PurgeDocumentsResponse\x12\x36google.cloud.discoveryengine.v1.PurgeDocumentsMetadata\x82\xd3\xe4\x93\x02\xb0\x01\"K/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge:\x01*Z^\"Y/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge:\x01*\x12\xf3\x02\n\x19\x42\x61tchGetDocumentsMetadata\x12\x41.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest\x1a\x42.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse\"\xce\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbe\x01\x12U/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/batchGetDocumentsMetadataZe\x12\x63/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/batchGetDocumentsMetadata\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x87\x02\n#com.google.cloud.discoveryengine.v1B\x14\x44ocumentServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetDocumentRequest").msgclass + ListDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListDocumentsRequest").msgclass + ListDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListDocumentsResponse").msgclass + CreateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateDocumentRequest").msgclass + UpdateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateDocumentRequest").msgclass + DeleteDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteDocumentRequest").msgclass + BatchGetDocumentsMetadataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest").msgclass + BatchGetDocumentsMetadataRequest::UrisMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.UrisMatcher").msgclass + BatchGetDocumentsMetadataRequest::FhirMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcher").msgclass + BatchGetDocumentsMetadataRequest::Matcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.Matcher").msgclass + BatchGetDocumentsMetadataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse").msgclass + BatchGetDocumentsMetadataResponse::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata").msgclass + BatchGetDocumentsMetadataResponse::DocumentMetadata::MatcherValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata.MatcherValue").msgclass + BatchGetDocumentsMetadataResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb new file mode 100644 index 000000000000..4a36bd787832 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb @@ -0,0 +1,83 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/document_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/document_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module DocumentService + # Service for ingesting [Document][google.cloud.discoveryengine.v1.Document] + # information of the customer's website. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.DocumentService' + + # Gets a [Document][google.cloud.discoveryengine.v1.Document]. + rpc :GetDocument, ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document + # Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s. + rpc :ListDocuments, ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse + # Creates a [Document][google.cloud.discoveryengine.v1.Document]. + rpc :CreateDocument, ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document + # Updates a [Document][google.cloud.discoveryengine.v1.Document]. + rpc :UpdateDocument, ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document + # Deletes a [Document][google.cloud.discoveryengine.v1.Document]. + rpc :DeleteDocument, ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Google::Protobuf::Empty + # Bulk import of multiple + # [Document][google.cloud.discoveryengine.v1.Document]s. Request processing + # may be synchronous. Non-existing items are created. + # + # Note: It is possible for a subset of the + # [Document][google.cloud.discoveryengine.v1.Document]s to be successfully + # updated. + rpc :ImportDocuments, ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Google::Longrunning::Operation + # Permanently deletes all selected + # [Document][google.cloud.discoveryengine.v1.Document]s in a branch. + # + # This process is asynchronous. Depending on the number of + # [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this + # operation can take hours to complete. Before the delete operation + # completes, some [Document][google.cloud.discoveryengine.v1.Document]s might + # still be returned by + # [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument] + # or + # [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]. + # + # To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s + # to be deleted, set + # [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force] + # to false. + rpc :PurgeDocuments, ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Google::Longrunning::Operation + # Gets index freshness metadata for + # [Document][google.cloud.discoveryengine.v1.Document]s. Supported for + # website search only. + rpc :BatchGetDocumentsMetadata, ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb new file mode 100644 index 000000000000..3f1bef602c6d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/engine.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/discoveryengine/v1/engine.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe1\x14\n\x06\x45ngine\x12V\n\x12\x63hat_engine_config\x18\x0b \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.Engine.ChatEngineConfigH\x00\x12Z\n\x14search_engine_config\x18\r \x01(\x0b\x32:.google.cloud.discoveryengine.v1.Engine.SearchEngineConfigH\x00\x12u\n\"media_recommendation_engine_config\x18\x0e \x01(\x0b\x32G.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfigH\x00\x12_\n\x14\x63hat_engine_metadata\x18\x0c \x01(\x0b\x32:.google.cloud.discoveryengine.v1.Engine.ChatEngineMetadataB\x03\xe0\x41\x03H\x01\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x64\x61ta_store_ids\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12I\n\rsolution_type\x18\x06 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x10 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x01\x12K\n\rcommon_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Engine.CommonConfig\x12\x1e\n\x11\x64isable_analytics\x18\x1a \x01(\x08\x42\x03\xe0\x41\x01\x1a\x9c\x01\n\x12SearchEngineConfig\x12@\n\x0bsearch_tier\x18\x01 \x01(\x0e\x32+.google.cloud.discoveryengine.v1.SearchTier\x12\x44\n\x0esearch_add_ons\x18\x02 \x03(\x0e\x32,.google.cloud.discoveryengine.v1.SearchAddOn\x1a\xb6\x08\n\x1fMediaRecommendationEngineConfig\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x16optimization_objective\x18\x02 \x01(\t\x12\x8a\x01\n\x1doptimization_objective_config\x18\x03 \x01(\x0b\x32\x63.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.OptimizationObjectiveConfig\x12m\n\x0etraining_state\x18\x04 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.TrainingState\x12\x81\x01\n\x16\x65ngine_features_config\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.EngineFeaturesConfigB\x03\xe0\x41\x01\x1a_\n\x1bOptimizationObjectiveConfig\x12\x19\n\x0ctarget_field\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12%\n\x18target_field_value_float\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x1a\xbf\x02\n\x14\x45ngineFeaturesConfig\x12\x8c\x01\n\x1arecommended_for_you_config\x18\x01 \x01(\x0b\x32\x66.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.RecommendedForYouFeatureConfigH\x00\x12\x7f\n\x13most_popular_config\x18\x02 \x01(\x0b\x32`.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.MostPopularFeatureConfigH\x00\x42\x17\n\x15type_dedicated_config\x1a<\n\x1eRecommendedForYouFeatureConfig\x12\x1a\n\x12\x63ontext_event_type\x18\x01 \x01(\t\x1a\x34\n\x18MostPopularFeatureConfig\x12\x18\n\x10time_window_days\x18\x01 \x01(\x03\"I\n\rTrainingState\x12\x1e\n\x1aTRAINING_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x1a\xb4\x02\n\x10\x43hatEngineConfig\x12k\n\x15\x61gent_creation_config\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.Engine.ChatEngineConfig.AgentCreationConfig\x12 \n\x18\x64ialogflow_agent_to_link\x18\x02 \x01(\t\x12\x1f\n\x12\x61llow_cross_region\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1ap\n\x13\x41gentCreationConfig\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\x1d\n\x15\x64\x65\x66\x61ult_language_code\x18\x02 \x01(\t\x12\x16\n\ttime_zone\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08location\x18\x04 \x01(\t\x1a$\n\x0c\x43ommonConfig\x12\x14\n\x0c\x63ompany_name\x18\x01 \x01(\t\x1a.\n\x12\x43hatEngineMetadata\x12\x18\n\x10\x64ialogflow_agent\x18\x01 \x01(\t:}\xea\x41z\n%discoveryengine.googleapis.com/Engine\x12Qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}B\x0f\n\rengine_configB\x11\n\x0f\x65ngine_metadataB\xfe\x01\n#com.google.cloud.discoveryengine.v1B\x0b\x45ngineProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Engine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine").msgclass + Engine::SearchEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.SearchEngineConfig").msgclass + Engine::MediaRecommendationEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig").msgclass + Engine::MediaRecommendationEngineConfig::OptimizationObjectiveConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.OptimizationObjectiveConfig").msgclass + Engine::MediaRecommendationEngineConfig::EngineFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.EngineFeaturesConfig").msgclass + Engine::MediaRecommendationEngineConfig::RecommendedForYouFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.RecommendedForYouFeatureConfig").msgclass + Engine::MediaRecommendationEngineConfig::MostPopularFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.MostPopularFeatureConfig").msgclass + Engine::MediaRecommendationEngineConfig::TrainingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.TrainingState").enummodule + Engine::ChatEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineConfig").msgclass + Engine::ChatEngineConfig::AgentCreationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineConfig.AgentCreationConfig").msgclass + Engine::CommonConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.CommonConfig").msgclass + Engine::ChatEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb new file mode 100644 index 000000000000..02ec976cd98a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/engine_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/engine_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/discoveryengine/v1/engine_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xae\x01\n\x13\x43reateEngineRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12<\n\x06\x65ngine\x18\x02 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.EngineB\x03\xe0\x41\x02\x12\x16\n\tengine_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"x\n\x14\x43reateEngineMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"R\n\x13\x44\x65leteEngineRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\"x\n\x14\x44\x65leteEngineMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"O\n\x10GetEngineRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\"\x9d\x01\n\x12ListEnginesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"h\n\x13ListEnginesResponse\x12\x38\n\x07\x65ngines\x18\x01 \x03(\x0b\x32\'.google.cloud.discoveryengine.v1.Engine\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x13UpdateEngineRequest\x12<\n\x06\x65ngine\x18\x01 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.EngineB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xe3\t\n\rEngineService\x12\xaa\x02\n\x0c\x43reateEngine\x12\x34.google.cloud.discoveryengine.v1.CreateEngineRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41^\n&google.cloud.discoveryengine.v1.Engine\x12\x34google.cloud.discoveryengine.v1.CreateEngineMetadata\xda\x41\x17parent,engine,engine_id\x82\xd3\xe4\x93\x02\x43\"9/v1/{parent=projects/*/locations/*/collections/*}/engines:\x06\x65ngine\x12\xfe\x01\n\x0c\x44\x65leteEngine\x12\x34.google.cloud.discoveryengine.v1.DeleteEngineRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41M\n\x15google.protobuf.Empty\x12\x34google.cloud.discoveryengine.v1.DeleteEngineMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/collections/*/engines/*}\x12\xd4\x01\n\x0cUpdateEngine\x12\x34.google.cloud.discoveryengine.v1.UpdateEngineRequest\x1a\'.google.cloud.discoveryengine.v1.Engine\"e\xda\x41\x12\x65ngine,update_mask\x82\xd3\xe4\x93\x02J2@/v1/{engine.name=projects/*/locations/*/collections/*/engines/*}:\x06\x65ngine\x12\xb1\x01\n\tGetEngine\x12\x31.google.cloud.discoveryengine.v1.GetEngineRequest\x1a\'.google.cloud.discoveryengine.v1.Engine\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/collections/*/engines/*}\x12\xc4\x01\n\x0bListEngines\x12\x33.google.cloud.discoveryengine.v1.ListEnginesRequest\x1a\x34.google.cloud.discoveryengine.v1.ListEnginesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/collections/*}/engines\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12\x45ngineServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.Engine", "google/cloud/discoveryengine/v1/engine.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + CreateEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateEngineRequest").msgclass + CreateEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateEngineMetadata").msgclass + DeleteEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteEngineRequest").msgclass + DeleteEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteEngineMetadata").msgclass + GetEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetEngineRequest").msgclass + ListEnginesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListEnginesRequest").msgclass + ListEnginesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListEnginesResponse").msgclass + UpdateEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateEngineRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb new file mode 100644 index 000000000000..3752d22f8197 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/engine_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/engine_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module EngineService + # Service for managing [Engine][google.cloud.discoveryengine.v1.Engine] + # configuration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.EngineService' + + # Creates a [Engine][google.cloud.discoveryengine.v1.Engine]. + rpc :CreateEngine, ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Google::Longrunning::Operation + # Deletes a [Engine][google.cloud.discoveryengine.v1.Engine]. + rpc :DeleteEngine, ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Google::Longrunning::Operation + # Updates an [Engine][google.cloud.discoveryengine.v1.Engine] + rpc :UpdateEngine, ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::Engine + # Gets a [Engine][google.cloud.discoveryengine.v1.Engine]. + rpc :GetEngine, ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::Engine + # Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated + # with the project. + rpc :ListEngines, ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb new file mode 100644 index 000000000000..f506c7527d54 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/grounded_generation_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/grounding_pb' + + +descriptor_data = "\nAgoogle/cloud/discoveryengine/v1/grounded_generation_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/discoveryengine/v1/grounding.proto\"\x99\x01\n\x19GroundedGenerationContent\x12\x0c\n\x04role\x18\x01 \x01(\t\x12N\n\x05parts\x18\x02 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.GroundedGenerationContent.Part\x1a\x1e\n\x04Part\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x42\x06\n\x04\x64\x61ta\"\x9f\x15\n\x1eGenerateGroundedContentRequest\x12\x41\n\x08location\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Location\x12V\n\x12system_instruction\x18\x05 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12L\n\x08\x63ontents\x18\x02 \x03(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12g\n\x0fgeneration_spec\x18\x03 \x01(\x0b\x32N.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec\x12\x65\n\x0egrounding_spec\x18\x04 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec\x12\x64\n\x0buser_labels\x18\x06 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.UserLabelsEntry\x1a\xdb\x02\n\x0eGenerationSpec\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x18\n\x0btemperature\x18\x04 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05top_p\x18\x05 \x01(\x02H\x01\x88\x01\x01\x12\x12\n\x05top_k\x18\x07 \x01(\x05H\x02\x88\x01\x01\x12\x1e\n\x11\x66requency_penalty\x18\x08 \x01(\x02H\x03\x88\x01\x01\x12\x11\n\x04seed\x18\x0c \x01(\x05H\x04\x88\x01\x01\x12\x1d\n\x10presence_penalty\x18\t \x01(\x02H\x05\x88\x01\x01\x12\x1e\n\x11max_output_tokens\x18\n \x01(\x05H\x06\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x08\n\x06_top_kB\x14\n\x12_frequency_penaltyB\x07\n\x05_seedB\x13\n\x11_presence_penaltyB\x14\n\x12_max_output_tokens\x1a\xbb\x03\n\x1d\x44ynamicRetrievalConfiguration\x12\x8a\x01\n\tpredictor\x18\x01 \x01(\x0b\x32w.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor\x1a\x8c\x02\n\x19\x44ynamicRetrievalPredictor\x12\x90\x01\n\x07version\x18\x01 \x01(\x0e\x32\x7f.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version\x12\x16\n\tthreshold\x18\x02 \x01(\x02H\x00\x88\x01\x01\"6\n\x07Version\x12\x17\n\x13VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0eV1_INDEPENDENT\x10\x01\x42\x0c\n\n_threshold\x1a\x91\t\n\x0fGroundingSource\x12u\n\rinline_source\x18\x01 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSourceH\x00\x12u\n\rsearch_source\x18\x02 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSourceH\x00\x12\x82\x01\n\x14google_search_source\x18\x03 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSourceH\x00\x12\x97\x01\n\x1f\x65nterprise_web_retrieval_source\x18\x08 \x01(\x0b\x32l.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.EnterpriseWebRetrievalSourceH\x00\x1a\x8d\x02\n\x0cInlineSource\x12G\n\x0fgrounding_facts\x18\x01 \x03(\x0b\x32..google.cloud.discoveryengine.v1.GroundingFact\x12\x80\x01\n\nattributes\x18\x02 \x03(\x0b\x32l.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x98\x01\n\x0cSearchSource\x12I\n\x0eserving_config\x18\x01 \x01(\tB1\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12\x18\n\x10max_result_count\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x13\n\x0bsafe_search\x18\x05 \x01(\x08\x1a\x9b\x01\n\x12GoogleSearchSource\x12\x84\x01\n\x18\x64ynamic_retrieval_config\x18\x02 \x01(\x0b\x32].google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfigurationB\x03\xe0\x41\x01\x1a\x1e\n\x1c\x45nterpriseWebRetrievalSourceB\x08\n\x06source\x1a{\n\rGroundingSpec\x12j\n\x11grounding_sources\x18\x01 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe9\x14\n\x1fGenerateGroundedContentResponse\x12^\n\ncandidates\x18\x01 \x03(\x0b\x32J.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate\x1a\xe5\x13\n\tCandidate\x12\r\n\x05index\x18\x01 \x01(\x05\x12K\n\x07\x63ontent\x18\x02 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12\x1c\n\x0fgrounding_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x12x\n\x12grounding_metadata\x18\x04 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata\x1a\xcf\x11\n\x11GroundingMetadata\x12\x8a\x01\n\x12retrieval_metadata\x18\x05 \x03(\x0b\x32n.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata\x12\x42\n\x0esupport_chunks\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.FactChunk\x12\x1a\n\x12web_search_queries\x18\x03 \x03(\t\x12\x89\x01\n\x12search_entry_point\x18\x04 \x01(\x0b\x32m.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint\x12\x88\x01\n\x11grounding_support\x18\x02 \x03(\x0b\x32m.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport\x12z\n\x06images\x18\t \x03(\x0b\x32j.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata\x1a\xa7\x03\n\x11RetrievalMetadata\x12\x85\x01\n\x06source\x18\x01 \x01(\x0e\x32u.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source\x12\x99\x01\n\x1a\x64ynamic_retrieval_metadata\x18\x02 \x01(\x0b\x32u.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata\"n\n\x06Source\x12\x16\n\x12SOURCE_UNSPECIFIED\x10\x00\x12\x14\n\x10VERTEX_AI_SEARCH\x10\x01\x12\x11\n\rGOOGLE_SEARCH\x10\x03\x12\x12\n\x0eINLINE_CONTENT\x10\x02\x12\x0f\n\x0bGOOGLE_MAPS\x10\x04\x1a\xb7\x01\n\x18\x44ynamicRetrievalMetadata\x12\x9a\x01\n\x12predictor_metadata\x18\x01 \x01(\x0b\x32~.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata\x1a\x9e\x02\n!DynamicRetrievalPredictorMetadata\x12\x98\x01\n\x07version\x18\x01 \x01(\x0e\x32\x86\x01.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version\x12\x17\n\nprediction\x18\x02 \x01(\x02H\x00\x88\x01\x01\"6\n\x07Version\x12\x17\n\x13VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0eV1_INDEPENDENT\x10\x01\x42\r\n\x0b_prediction\x1a>\n\x10SearchEntryPoint\x12\x18\n\x10rendered_content\x18\x01 \x01(\t\x12\x10\n\x08sdk_blob\x18\x02 \x01(\x0c\x1as\n\x10GroundingSupport\x12\x12\n\nclaim_text\x18\x01 \x01(\t\x12\x1d\n\x15support_chunk_indices\x18\x03 \x03(\x05\x12\x1a\n\rsupport_score\x18\x02 \x01(\x02H\x00\x88\x01\x01\x42\x10\n\x0e_support_score\x1a\xff\x03\n\rImageMetadata\x12\x7f\n\x05image\x18\x01 \x01(\x0b\x32p.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image\x12\x83\x01\n\tthumbnail\x18\x02 \x01(\x0b\x32p.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image\x12\x86\x01\n\x06source\x18\x03 \x01(\x0b\x32v.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.WebsiteInfo\x1a)\n\x0bWebsiteInfo\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x1a\x33\n\x05Image\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x42\x12\n\x10_grounding_score\"\x90\x01\n\x12\x43heckGroundingSpec\x12\x1f\n\x12\x63itation_threshold\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12%\n\x18\x65nable_claim_level_score\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x15\n\x13_citation_thresholdB\x1b\n\x19_enable_claim_level_score\"\x9f\x03\n\x15\x43heckGroundingRequest\x12P\n\x10grounding_config\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.discoveryengine.googleapis.com/GroundingConfig\x12\x18\n\x10\x61nswer_candidate\x18\x02 \x01(\t\x12=\n\x05\x66\x61\x63ts\x18\x03 \x03(\x0b\x32..google.cloud.discoveryengine.v1.GroundingFact\x12K\n\x0egrounding_spec\x18\x04 \x01(\x0b\x32\x33.google.cloud.discoveryengine.v1.CheckGroundingSpec\x12[\n\x0buser_labels\x18\x05 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.CheckGroundingRequest.UserLabelsEntry\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xce\x04\n\x16\x43heckGroundingResponse\x12\x1a\n\rsupport_score\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12@\n\x0c\x63ited_chunks\x18\x03 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.FactChunk\x12\x64\n\x0b\x63ited_facts\x18\x06 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.CheckGroundingResponse.CheckGroundingFactChunk\x12M\n\x06\x63laims\x18\x04 \x03(\x0b\x32=.google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim\x1a-\n\x17\x43heckGroundingFactChunk\x12\x12\n\nchunk_text\x18\x01 \x01(\t\x1a\xdf\x01\n\x05\x43laim\x12\x16\n\tstart_pos\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x14\n\x07\x65nd_pos\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\nclaim_text\x18\x03 \x01(\t\x12\x18\n\x10\x63itation_indices\x18\x04 \x03(\x05\x12%\n\x18grounding_check_required\x18\x06 \x01(\x08H\x02\x88\x01\x01\x12\x12\n\x05score\x18\x07 \x01(\x01H\x03\x88\x01\x01\x42\x0c\n\n_start_posB\n\n\x08_end_posB\x1b\n\x19_grounding_check_requiredB\x08\n\x06_scoreB\x10\n\x0e_support_score2\xa8\x06\n\x19GroundedGenerationService\x12\xf6\x01\n\x1dStreamGenerateGroundedContent\x12?.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest\x1a@.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse\"N\x82\xd3\xe4\x93\x02H\"C/v1/{location=projects/*/locations/*}:streamGenerateGroundedContent:\x01*(\x01\x30\x01\x12\xe6\x01\n\x17GenerateGroundedContent\x12?.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest\x1a@.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{location=projects/*/locations/*}:generateGroundedContent:\x01*\x12\xd4\x01\n\x0e\x43heckGrounding\x12\x36.google.cloud.discoveryengine.v1.CheckGroundingRequest\x1a\x37.google.cloud.discoveryengine.v1.CheckGroundingResponse\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{grounding_config=projects/*/locations/*/groundingConfigs/*}:check:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x91\x02\n#com.google.cloud.discoveryengine.v1B\x1eGroundedGenerationServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.GroundingFact", "google/cloud/discoveryengine/v1/grounding.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + GroundedGenerationContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundedGenerationContent").msgclass + GroundedGenerationContent::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundedGenerationContent.Part").msgclass + GenerateGroundedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest").msgclass + GenerateGroundedContentRequest::GenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec").msgclass + GenerateGroundedContentRequest::DynamicRetrievalConfiguration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration").msgclass + GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor").msgclass + GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor::Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version").enummodule + GenerateGroundedContentRequest::GroundingSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource").msgclass + GenerateGroundedContentRequest::GroundingSource::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource").msgclass + GenerateGroundedContentRequest::GroundingSource::SearchSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource").msgclass + GenerateGroundedContentRequest::GroundingSource::GoogleSearchSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSource").msgclass + GenerateGroundedContentRequest::GroundingSource::EnterpriseWebRetrievalSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.EnterpriseWebRetrievalSource").msgclass + GenerateGroundedContentRequest::GroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec").msgclass + GenerateGroundedContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse").msgclass + GenerateGroundedContentResponse::Candidate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata::Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source").enummodule + GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata::Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version").enummodule + GenerateGroundedContentResponse::Candidate::GroundingMetadata::SearchEntryPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::GroundingSupport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::WebsiteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.WebsiteInfo").msgclass + GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image").msgclass + CheckGroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingSpec").msgclass + CheckGroundingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingRequest").msgclass + CheckGroundingResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse").msgclass + CheckGroundingResponse::CheckGroundingFactChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse.CheckGroundingFactChunk").msgclass + CheckGroundingResponse::Claim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb new file mode 100644 index 000000000000..f579120188fb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/grounded_generation_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/grounded_generation_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module GroundedGenerationService + # Service for grounded generation. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.GroundedGenerationService' + + # Generates grounded content in a streaming fashion. + rpc :StreamGenerateGroundedContent, stream(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest), stream(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse) + # Generates grounded content. + rpc :GenerateGroundedContent, ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse + # Performs a grounding check. + rpc :CheckGrounding, ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb new file mode 100644 index 000000000000..300c5940833b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/grounding.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n/google/cloud/discoveryengine/v1/grounding.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa9\x01\n\rGroundingFact\x12\x11\n\tfact_text\x18\x01 \x01(\t\x12R\n\nattributes\x18\x02 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.GroundingFact.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfa\x01\n\tFactChunk\x12\x12\n\nchunk_text\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\r\n\x05index\x18\x04 \x01(\x05\x12W\n\x0fsource_metadata\x18\x03 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.FactChunk.SourceMetadataEntry\x12\x0b\n\x03uri\x18\x05 \x01(\t\x12\r\n\x05title\x18\x06 \x01(\t\x12\x0e\n\x06\x64omain\x18\x07 \x01(\t\x1a\x35\n\x13SourceMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0eGroundingProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + GroundingFact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundingFact").msgclass + FactChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FactChunk").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb new file mode 100644 index 000000000000..55f73b95b1a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/identity_mapping_store.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' + + +descriptor_data = "\n.google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest\x1a\x1d.google.longrunning.Operation\"\xf8\x01\xca\x41\x87\x01\n>google.cloud.discoveryengine.v1.ImportIdentityMappingsResponse\x12\x45google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata\x82\xd3\xe4\x93\x02g\"b/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:importIdentityMappings:\x01*\x12\xc5\x02\n\x15PurgeIdentityMappings\x12=.google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest\x1a\x1d.google.longrunning.Operation\"\xcd\x01\xca\x41^\n\x15google.protobuf.Empty\x12\x45google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata\x82\xd3\xe4\x93\x02\x66\"a/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:purgeIdentityMappings:\x01*\x12\xfd\x01\n\x14ListIdentityMappings\x12<.google.cloud.discoveryengine.v1.ListIdentityMappingsRequest\x1a=.google.cloud.discoveryengine.v1.ListIdentityMappingsResponse\"h\x82\xd3\xe4\x93\x02\x62\x12`/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:listIdentityMappings\x12\xee\x01\n\x19ListIdentityMappingStores\x12\x41.google.cloud.discoveryengine.v1.ListIdentityMappingStoresRequest\x1a\x42.google.cloud.discoveryengine.v1.ListIdentityMappingStoresResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/identityMappingStores\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n#com.google.cloud.discoveryengine.v1B IdentityMappingStoreServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.IdentityMappingStore", "google/cloud/discoveryengine/v1/identity_mapping_store.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + CreateIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateIdentityMappingStoreRequest").msgclass + GetIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetIdentityMappingStoreRequest").msgclass + DeleteIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteIdentityMappingStoreRequest").msgclass + ImportIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest").msgclass + ImportIdentityMappingsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest.InlineSource").msgclass + ImportIdentityMappingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsResponse").msgclass + PurgeIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest").msgclass + PurgeIdentityMappingsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest.InlineSource").msgclass + ListIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingsRequest").msgclass + ListIdentityMappingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingsResponse").msgclass + ListIdentityMappingStoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingStoresRequest").msgclass + ListIdentityMappingStoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingStoresResponse").msgclass + IdentityMappingEntryOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata").msgclass + DeleteIdentityMappingStoreMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteIdentityMappingStoreMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb new file mode 100644 index 000000000000..1794bb14c265 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/identity_mapping_store_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/identity_mapping_store_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module IdentityMappingStoreService + # Service for managing Identity Mapping Stores. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.IdentityMappingStoreService' + + # Creates a new Identity Mapping Store. + rpc :CreateIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore + # Gets the Identity Mapping Store. + rpc :GetIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore + # Deletes the Identity Mapping Store. + rpc :DeleteIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Google::Longrunning::Operation + # Imports a list of Identity Mapping Entries to an Identity Mapping Store. + rpc :ImportIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Google::Longrunning::Operation + # Purges specified or all Identity Mapping Entries from an Identity Mapping + # Store. + rpc :PurgeIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Google::Longrunning::Operation + # Lists Identity Mappings in an Identity Mapping Store. + rpc :ListIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse + # Lists all Identity Mapping Stores. + rpc :ListIdentityMappingStores, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb new file mode 100644 index 000000000000..165a3dd47545 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/import_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/completion_pb' +require 'google/cloud/discoveryengine/v1/document_pb' +require 'google/cloud/discoveryengine/v1/user_event_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/date_pb' + + +descriptor_data = "\n3google/cloud/discoveryengine/v1/import_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/discoveryengine/v1/completion.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x30google/cloud/discoveryengine/v1/user_event.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\"9\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61ta_schema\x18\x02 \x01(\t\"\xbc\x01\n\x0e\x42igQuerySource\x12+\n\x0epartition_date\x18\x05 \x01(\x0b\x32\x11.google.type.DateH\x00\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x61ta_schema\x18\x06 \x01(\tB\x0b\n\tpartition\"\x89\x01\n\rSpannerSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x11\x65nable_data_boost\x18\x05 \x01(\x08\"\x8d\x07\n\x0f\x42igtableOptions\x12\x16\n\x0ekey_field_name\x18\x01 \x01(\t\x12P\n\x08\x66\x61milies\x18\x02 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.BigtableOptions.FamiliesEntry\x1a\x8e\x02\n\x14\x42igtableColumnFamily\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12K\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32\x39.google.cloud.discoveryengine.v1.BigtableOptions.Encoding\x12\x43\n\x04type\x18\x03 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.BigtableOptions.Type\x12P\n\x07\x63olumns\x18\x04 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumn\x1a\xce\x01\n\x0e\x42igtableColumn\x12\x16\n\tqualifier\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12K\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x39.google.cloud.discoveryengine.v1.BigtableOptions.Encoding\x12\x43\n\x04type\x18\x04 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.BigtableOptions.Type\x1av\n\rFamiliesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12T\n\x05value\x18\x02 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumnFamily:\x02\x38\x01\"z\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06NUMBER\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x0f\n\x0bVAR_INTEGER\x10\x04\x12\x0f\n\x0b\x42IG_NUMERIC\x10\x05\x12\x0b\n\x07\x42OOLEAN\x10\x06\x12\x08\n\x04JSON\x10\x07\":\n\x08\x45ncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\n\n\x06\x42INARY\x10\x02\"\xa6\x01\n\x0e\x42igtableSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12O\n\x10\x62igtable_options\x18\x04 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.BigtableOptionsB\x03\xe0\x41\x02\"\xb6\x01\n\x0f\x46hirStoreSource\x12?\n\nfhir_store\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#healthcare.googleapis.com/FhirStore\x12\x17\n\x0fgcs_staging_dir\x18\x02 \x01(\t\x12\x16\n\x0eresource_types\x18\x03 \x03(\t\x12\x31\n$update_from_latest_predefined_schema\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x99\x01\n\x0e\x43loudSqlSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x05 \x01(\t\x12\x0f\n\x07offload\x18\x06 \x01(\x08\"\xa0\x01\n\rAlloyDbSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0blocation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ncluster_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x06 \x01(\t\"t\n\x0f\x46irestoreSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x04 \x01(\t\"8\n\x11ImportErrorConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xf3\x03\n\x17ImportUserEventsRequest\x12^\n\rinline_source\x18\x02 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x1aT\n\x0cInlineSource\x12\x44\n\x0buser_events\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.UserEventB\x03\xe0\x41\x02\x42\x08\n\x06source\"\xcb\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x1b\n\x13joined_events_count\x18\x03 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x04 \x01(\x03\"\xaa\x01\n\x18ImportUserEventsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"\xbe\x01\n\x17ImportDocumentsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x13\n\x0btotal_count\x18\x05 \x01(\x03\"\xf7\t\n\x16ImportDocumentsRequest\x12]\n\rinline_source\x18\x02 \x01(\x0b\x32\x44.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12M\n\x11\x66hir_store_source\x18\n \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.FhirStoreSourceH\x00\x12H\n\x0espanner_source\x18\x0b \x01(\x0b\x32..google.cloud.discoveryengine.v1.SpannerSourceH\x00\x12K\n\x10\x63loud_sql_source\x18\x0c \x01(\x0b\x32/.google.cloud.discoveryengine.v1.CloudSqlSourceH\x00\x12L\n\x10\x66irestore_source\x18\r \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.FirestoreSourceH\x00\x12I\n\x0f\x61lloy_db_source\x18\x0e \x01(\x0b\x32..google.cloud.discoveryengine.v1.AlloyDbSourceH\x00\x12J\n\x0f\x62igtable_source\x18\x0f \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigtableSourceH\x00\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12g\n\x13reconciliation_mode\x18\x06 \x01(\x0e\x32J.google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode\x12/\n\x0bupdate_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x19\n\x11\x61uto_generate_ids\x18\x08 \x01(\x08\x12\x10\n\x08id_field\x18\t \x01(\t\x12\"\n\x15\x66orce_refresh_content\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x1aQ\n\x0cInlineSource\x12\x41\n\tdocuments\x18\x01 \x03(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\"T\n\x12ReconciliationMode\x12#\n\x1fRECONCILIATION_MODE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINCREMENTAL\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x42\x08\n\x06source\"\x8e\x01\n\x17ImportDocumentsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\"\x85\x03\n&ImportSuggestionDenyListEntriesRequest\x12m\n\rinline_source\x18\x02 \x01(\x0b\x32T.google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a^\n\x0cInlineSource\x12N\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SuggestionDenyListEntryB\x03\xe0\x41\x02\x42\x08\n\x06source\"\x92\x01\n\'ImportSuggestionDenyListEntriesResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16imported_entries_count\x18\x02 \x01(\x03\x12\x1c\n\x14\x66\x61iled_entries_count\x18\x03 \x01(\x03\"\x8b\x01\n\'ImportSuggestionDenyListEntriesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x94\x04\n\"ImportCompletionSuggestionsRequest\x12i\n\rinline_source\x18\x02 \x01(\x0b\x32P.google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x1a_\n\x0cInlineSource\x12O\n\x0bsuggestions\x18\x01 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.CompletionSuggestionB\x03\xe0\x41\x02\x42\x08\n\x06source\"\x9a\x01\n#ImportCompletionSuggestionsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\"\xb5\x01\n#ImportCompletionSuggestionsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x42\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11ImportConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.type.Date", "google/type/date.proto"], + ["google.cloud.discoveryengine.v1.UserEvent", "google/cloud/discoveryengine/v1/user_event.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], + ["google.cloud.discoveryengine.v1.SuggestionDenyListEntry", "google/cloud/discoveryengine/v1/completion.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GcsSource").msgclass + BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigQuerySource").msgclass + SpannerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SpannerSource").msgclass + BigtableOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions").msgclass + BigtableOptions::BigtableColumnFamily = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumnFamily").msgclass + BigtableOptions::BigtableColumn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumn").msgclass + BigtableOptions::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.Type").enummodule + BigtableOptions::Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.Encoding").enummodule + BigtableSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableSource").msgclass + FhirStoreSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FhirStoreSource").msgclass + CloudSqlSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CloudSqlSource").msgclass + AlloyDbSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AlloyDbSource").msgclass + FirestoreSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FirestoreSource").msgclass + ImportErrorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportErrorConfig").msgclass + ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsRequest").msgclass + ImportUserEventsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource").msgclass + ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsResponse").msgclass + ImportUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsMetadata").msgclass + ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsMetadata").msgclass + ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest").msgclass + ImportDocumentsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource").msgclass + ImportDocumentsRequest::ReconciliationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode").enummodule + ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsResponse").msgclass + ImportSuggestionDenyListEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest").msgclass + ImportSuggestionDenyListEntriesRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest.InlineSource").msgclass + ImportSuggestionDenyListEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesResponse").msgclass + ImportSuggestionDenyListEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesMetadata").msgclass + ImportCompletionSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest").msgclass + ImportCompletionSuggestionsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest.InlineSource").msgclass + ImportCompletionSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsResponse").msgclass + ImportCompletionSuggestionsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb new file mode 100644 index 000000000000..ca756d1603db --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/project.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/discoveryengine/v1/project.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdd\x05\n\x07Project\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19provision_completion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12]\n\x11service_terms_map\x18\x04 \x03(\x0b\x32=.google.cloud.discoveryengine.v1.Project.ServiceTermsMapEntryB\x03\xe0\x41\x03\x1a\xb5\x02\n\x0cServiceTerms\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12J\n\x05state\x18\x04 \x01(\x0e\x32;.google.cloud.discoveryengine.v1.Project.ServiceTerms.State\x12/\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x64\x65\x63line_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTERMS_ACCEPTED\x10\x01\x12\x11\n\rTERMS_PENDING\x10\x02\x12\x12\n\x0eTERMS_DECLINED\x10\x03\x1am\n\x14ServiceTermsMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.Project.ServiceTerms:\x02\x38\x01:?\xea\x41<\n&discoveryengine.googleapis.com/Project\x12\x12projects/{project}B\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0cProjectProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Project = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project").msgclass + Project::ServiceTerms = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project.ServiceTerms").msgclass + Project::ServiceTerms::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project.ServiceTerms.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb new file mode 100644 index 000000000000..640ebf06f334 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/project_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/project_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n5google/cloud/discoveryengine/v1/project_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/discoveryengine/v1/project.proto\x1a#google/longrunning/operations.proto\"\xa0\x01\n\x17ProvisionProjectRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Project\x12\"\n\x15\x61\x63\x63\x65pt_data_use_terms\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x12#\n\x16\x64\x61ta_use_terms_version\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x1a\n\x18ProvisionProjectMetadata2\xec\x02\n\x0eProjectService\x12\x85\x02\n\x10ProvisionProject\x12\x38.google.cloud.discoveryengine.v1.ProvisionProjectRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41\x63\n\'google.cloud.discoveryengine.v1.Project\x12\x38google.cloud.discoveryengine.v1.ProvisionProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02$\"\x1f/v1/{name=projects/*}:provision:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13ProjectServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + ProvisionProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ProvisionProjectRequest").msgclass + ProvisionProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ProvisionProjectMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb new file mode 100644 index 000000000000..c35c2be5e36c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/project_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/project_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module ProjectService + # Service for operations on the + # [Project][google.cloud.discoveryengine.v1.Project]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.ProjectService' + + # Provisions the project resource. During the + # process, related systems will get prepared and initialized. + # + # Caller must read the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms), and optionally + # specify in request to provide consent to that service terms. + rpc :ProvisionProject, ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb new file mode 100644 index 000000000000..b03c285bb6a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/purge_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/import_config_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/cloud/discoveryengine/v1/purge_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"~\n\x16PurgeUserEventsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\".\n\x17PurgeUserEventsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\"\xa9\x01\n\x17PurgeUserEventsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"7\n\x10PurgeErrorConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xc1\x03\n\x15PurgeDocumentsRequest\x12@\n\ngcs_source\x18\x05 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12\\\n\rinline_source\x18\x06 \x01(\x0b\x32\x43.google.cloud.discoveryengine.v1.PurgeDocumentsRequest.InlineSourceH\x00\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0c\x65rror_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.discoveryengine.v1.PurgeErrorConfig\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\x1aR\n\x0cInlineSource\x12\x42\n\tdocuments\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentB\x08\n\x06source\"q\n\x16PurgeDocumentsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12\x42\n\x0cpurge_sample\x18\x02 \x03(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"\xbf\x01\n\x16PurgeDocumentsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x15\n\rignored_count\x18\x05 \x01(\x03\"i\n%PurgeSuggestionDenyListEntriesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"h\n&PurgeSuggestionDenyListEntriesResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x8a\x01\n&PurgeSuggestionDenyListEntriesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n!PurgeCompletionSuggestionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"h\n\"PurgeCompletionSuggestionsResponse\x12\x17\n\x0fpurge_succeeded\x18\x01 \x01(\x08\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x86\x01\n\"PurgeCompletionSuggestionsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10PurgeConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.GcsSource", "google/cloud/discoveryengine/v1/import_config.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsRequest").msgclass + PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsResponse").msgclass + PurgeUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsMetadata").msgclass + PurgeErrorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeErrorConfig").msgclass + PurgeDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsRequest").msgclass + PurgeDocumentsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsRequest.InlineSource").msgclass + PurgeDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsResponse").msgclass + PurgeDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsMetadata").msgclass + PurgeSuggestionDenyListEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesRequest").msgclass + PurgeSuggestionDenyListEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse").msgclass + PurgeSuggestionDenyListEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata").msgclass + PurgeCompletionSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsRequest").msgclass + PurgeCompletionSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsResponse").msgclass + PurgeCompletionSuggestionsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb new file mode 100644 index 000000000000..a66ecbb6b4f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/rank_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n2google/cloud/discoveryengine/v1/rank_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"J\n\rRankingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\"\xff\x02\n\x0bRankRequest\x12L\n\x0eranking_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/RankingConfig\x12\r\n\x05model\x18\x02 \x01(\t\x12\r\n\x05top_n\x18\x03 \x01(\x05\x12\r\n\x05query\x18\x04 \x01(\t\x12\x44\n\x07records\x18\x05 \x03(\x0b\x32..google.cloud.discoveryengine.v1.RankingRecordB\x03\xe0\x41\x02\x12)\n!ignore_record_details_in_response\x18\x06 \x01(\x08\x12Q\n\x0buser_labels\x18\x07 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.RankRequest.UserLabelsEntry\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"O\n\x0cRankResponse\x12?\n\x07records\x18\x05 \x03(\x0b\x32..google.cloud.discoveryengine.v1.RankingRecord2\x95\x02\n\x0bRankService\x12\xb1\x01\n\x04Rank\x12,.google.cloud.discoveryengine.v1.RankRequest\x1a-.google.cloud.discoveryengine.v1.RankResponse\"L\x82\xd3\xe4\x93\x02\x46\"A/v1/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10RankServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + RankingRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankingRecord").msgclass + RankRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankRequest").msgclass + RankResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb new file mode 100644 index 000000000000..f4ae82f4ad0c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/rank_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/rank_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module RankService + # Service for ranking text records. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.RankService' + + # Ranks a list of text records based on the given input query. + rpc :Rank, ::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Google::Cloud::DiscoveryEngine::V1::RankResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb new file mode 100644 index 000000000000..c32f53968033 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/recommendation_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/document_pb' +require 'google/cloud/discoveryengine/v1/user_event_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x8c\x01\n)natural_language_query_understanding_spec\x18\x1c \x01(\x0b\x32T.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpecB\x03\xe0\x41\x01\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12X\n\x0e\x63rowding_specs\x18( \x03(\x0b\x32;.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xe0\x04\n%NaturalLanguageQueryUnderstandingSpec\x12\x93\x01\n\x1b\x66ilter_extraction_condition\x18\x01 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition\x12.\n&geo_search_query_detection_field_names\x18\x02 \x03(\t\x12\x94\x01\n\x19\x65xtracted_filter_behavior\x18\x03 \x01(\x0e\x32l.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehaviorB\x03\xe0\x41\x01\x12 \n\x13\x61llowed_field_names\x18\x04 \x03(\tB\x03\xe0\x41\x01\"Q\n\x19\x46ilterExtractionCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"e\n\x17\x45xtractedFilterBehavior\x12)\n%EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHARD_FILTER\x10\x01\x12\x0e\n\nSOFT_BOOST\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1a\xdb\x01\n\x0c\x43rowdingSpec\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12N\n\x04mode\x18\x03 \x01(\x0e\x32@.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode\"Y\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x44ROP_CROWDED_RESULTS\x10\x01\x12!\n\x1d\x44\x45MOTE_CROWDED_RESULTS_TO_END\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x92\x01\n\x18RankingExpressionBackend\x12*\n&RANKING_EXPRESSION_BACKEND_UNSPECIFIED\x10\x00\x12\x0c\n\x04\x42YOE\x10\x01\x1a\x02\x08\x01\x12\x10\n\x08\x43LEARBOX\x10\x02\x1a\x02\x08\x01\x12\x15\n\x11RANK_BY_EMBEDDING\x10\x03\x12\x13\n\x0fRANK_BY_FORMULA\x10\x04\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xe6/\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12\x8d\x01\n)natural_language_query_understanding_info\x18\x0f \x01(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfoB\x03\xe0\x41\x03\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x12Z\n\x0esemantic_state\x18$ \x01(\x0e\x32=.google.cloud.discoveryengine.v1.SearchResponse.SemanticStateB\x03\xe0\x41\x03\x1a\xa9\x08\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x12\x63\n\x0crank_signals\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignalsB\x03\xe0\x41\x01\x1a\xe8\x04\n\x0bRankSignals\x12*\n\x18keyword_similarity_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12!\n\x0frelevance_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12+\n\x19semantic_similarity_score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1b\n\tpctr_rank\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12!\n\x0ftopicality_rank\x18\x06 \x01(\x02\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1e\n\x0c\x64ocument_age\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12!\n\x0f\x62oosting_factor\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x19\n\x0c\x64\x65\x66\x61ult_rank\x18 \x01(\x02\x42\x03\xe0\x41\x01\x12r\n\x0e\x63ustom_signals\x18! \x03(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignalB\x03\xe0\x41\x01\x1a\x35\n\x0c\x43ustomSignal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x42\x1b\n\x19_keyword_similarity_scoreB\x12\n\x10_relevance_scoreB\x1c\n\x1a_semantic_similarity_scoreB\x0c\n\n_pctr_rankB\x12\n\x10_topicality_rankB\x0f\n\r_document_ageB\x12\n\x10_boosting_factor\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xf3\x10\n%NaturalLanguageQueryUnderstandingInfo\x12\x19\n\x11\x65xtracted_filters\x18\x01 \x01(\t\x12\x17\n\x0frewritten_query\x18\x02 \x01(\t\x12\x1a\n\x12\x63lassified_intents\x18\x05 \x03(\t\x12\x94\x01\n\x1bstructured_extracted_filter\x18\x03 \x01(\x0b\x32o.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter\x1a\xe2\x0e\n\x19StructuredExtractedFilter\x12\x8e\x01\n\nexpression\x18\x01 \x01(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1aM\n\x10StringConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0e\n\x06values\x18\x02 \x03(\t\x12\x15\n\rquery_segment\x18\x03 \x01(\t\x1a\xf6\x02\n\x10NumberConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\xa0\x01\n\ncomparison\x18\x02 \x01(\x0e\x32\x8b\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison\x12\r\n\x05value\x18\x03 \x01(\x01\x12\x15\n\rquery_segment\x18\x04 \x01(\t\"\x84\x01\n\nComparison\x12\x1a\n\x16\x43OMPARISON_UNSPECIFIED\x10\x00\x12\n\n\x06\x45QUALS\x10\x01\x12\x14\n\x10LESS_THAN_EQUALS\x10\x02\x12\r\n\tLESS_THAN\x10\x03\x12\x17\n\x13GREATER_THAN_EQUALS\x10\x04\x12\x10\n\x0cGREATER_THAN\x10\x05\x1a{\n\x15GeolocationConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x10\n\x08latitude\x18\x04 \x01(\x01\x12\x11\n\tlongitude\x18\x05 \x01(\x01\x12\x18\n\x10radius_in_meters\x18\x03 \x01(\x02\x1a\xa1\x01\n\rAndExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa0\x01\n\x0cOrExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa7\x06\n\nExpression\x12\x9e\x01\n\x11string_constraint\x18\x01 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraintH\x00\x12\x9e\x01\n\x11number_constraint\x18\x02 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraintH\x00\x12\xa8\x01\n\x16geolocation_constraint\x18\x03 \x01(\x0b\x32\x85\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraintH\x00\x12\x91\x01\n\x08\x61nd_expr\x18\x04 \x01(\x0b\x32}.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpressionH\x00\x12\x8f\x01\n\x07or_expr\x18\x05 \x01(\x0b\x32|.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpressionH\x00\x42\x06\n\x04\x65xpr\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t\"J\n\rSemanticState\x12\x1e\n\x1aSEMANTIC_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x32\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.UserInfo", "google/cloud/discoveryengine/v1/common.proto"], + ["google.protobuf.Value", "google/protobuf/struct.proto"], + ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], + ["google.cloud.discoveryengine.v1.Chunk", "google/cloud/discoveryengine/v1/chunk.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest").msgclass + SearchRequest::ImageQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ImageQuery").msgclass + SearchRequest::DataStoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec").msgclass + SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.FacetSpec").msgclass + SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey").msgclass + SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec").msgclass + SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass + SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass + SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass + SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule + SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule + SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec").msgclass + SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition").enummodule + SearchRequest::SpellCorrectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec").msgclass + SearchRequest::SpellCorrectionSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode").enummodule + SearchRequest::ContentSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec").msgclass + SearchRequest::ContentSearchSpec::SnippetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec").msgclass + SearchRequest::ContentSearchSpec::SummarySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec").msgclass + SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec").msgclass + SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec").msgclass + SearchRequest::ContentSearchSpec::ExtractiveContentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec").msgclass + SearchRequest::ContentSearchSpec::ChunkSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec").msgclass + SearchRequest::ContentSearchSpec::SearchResultMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode").enummodule + SearchRequest::NaturalLanguageQueryUnderstandingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec").msgclass + SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition").enummodule + SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehavior").enummodule + SearchRequest::SearchAsYouTypeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec").msgclass + SearchRequest::SearchAsYouTypeSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition").enummodule + SearchRequest::DisplaySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec").msgclass + SearchRequest::DisplaySpec::MatchHighlightingCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition").enummodule + SearchRequest::CrowdingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec").msgclass + SearchRequest::CrowdingSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode").enummodule + SearchRequest::SessionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SessionSpec").msgclass + SearchRequest::RelevanceScoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec").msgclass + SearchRequest::RankingExpressionBackend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend").enummodule + SearchRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold").enummodule + SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse").msgclass + SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult").msgclass + SearchResponse::SearchResult::RankSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals").msgclass + SearchResponse::SearchResult::RankSignals::CustomSignal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal").msgclass + SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet").msgclass + SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue").msgclass + SearchResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary").msgclass + SearchResponse::Summary::SafetyAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes").msgclass + SearchResponse::Summary::CitationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata").msgclass + SearchResponse::Summary::Citation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation").msgclass + SearchResponse::Summary::CitationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource").msgclass + SearchResponse::Summary::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference").msgclass + SearchResponse::Summary::Reference::ChunkContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent").msgclass + SearchResponse::Summary::SummaryWithMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata").msgclass + SearchResponse::Summary::SummarySkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason").enummodule + SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison").enummodule + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpression").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpression").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression").msgclass + SearchResponse::SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SessionInfo").msgclass + SearchResponse::SemanticState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SemanticState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb new file mode 100644 index 000000000000..a0f18b166895 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/search_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/search_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchService + # Service for search. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.SearchService' + + # Performs a search. + rpc :Search, ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Google::Cloud::DiscoveryEngine::V1::SearchResponse + # Performs a search. Similar to the + # [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] + # method, but a lite version that allows API key for authentication, where + # OAuth and IAM checks are not required. + # + # Only public website search is supported by this method. If data stores and + # engines not associated with public website search are specified, a + # `FAILED_PRECONDITION` error is returned. + # + # This method can be used for easy onboarding without having to implement an + # authentication backend. However, it is strongly recommended to use + # [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] + # instead with required OAuth and IAM checks to provide better data security. + rpc :SearchLite, ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Google::Cloud::DiscoveryEngine::V1::SearchResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb new file mode 100644 index 000000000000..582f3117b059 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/search_tuning_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/custom_tuning_model_pb' +require 'google/cloud/discoveryengine/v1/import_config_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n;google/cloud/discoveryengine/v1/search_tuning_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/custom_tuning_model.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"_\n\x17ListCustomModelsRequest\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"^\n\x18ListCustomModelsResponse\x12\x42\n\x06models\x18\x01 \x03(\x0b\x32\x32.google.cloud.discoveryengine.v1.CustomTuningModel\"\xc2\x03\n\x17TrainCustomModelRequest\x12g\n\x12gcs_training_input\x18\x02 \x01(\x0b\x32I.google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInputH\x00\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x12\n\nmodel_type\x18\x03 \x01(\t\x12H\n\x0c\x65rror_config\x18\x04 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x10\n\x08model_id\x18\x05 \x01(\t\x1av\n\x10GcsTrainingInput\x12\x18\n\x10\x63orpus_data_path\x18\x01 \x01(\t\x12\x17\n\x0fquery_data_path\x18\x02 \x01(\t\x12\x17\n\x0ftrain_data_path\x18\x03 \x01(\t\x12\x16\n\x0etest_data_path\x18\x04 \x01(\tB\x10\n\x0etraining_input\"\xc2\x02\n\x18TrainCustomModelResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x14\n\x0cmodel_status\x18\x03 \x01(\t\x12W\n\x07metrics\x18\x04 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.TrainCustomModelResponse.MetricsEntry\x12\x12\n\nmodel_name\x18\x05 \x01(\t\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"|\n\x18TrainCustomModelMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x92\x05\n\x13SearchTuningService\x12\xc3\x02\n\x10TrainCustomModel\x12\x38.google.cloud.discoveryengine.v1.TrainCustomModelRequest\x1a\x1d.google.longrunning.Operation\"\xd5\x01\xca\x41t\n8google.cloud.discoveryengine.v1.TrainCustomModelResponse\x12\x38google.cloud.discoveryengine.v1.TrainCustomModelMetadata\x82\xd3\xe4\x93\x02X\"S/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:trainCustomModel:\x01*\x12\xe0\x01\n\x10ListCustomModels\x12\x38.google.cloud.discoveryengine.v1.ListCustomModelsRequest\x1a\x39.google.cloud.discoveryengine.v1.ListCustomModelsResponse\"W\x82\xd3\xe4\x93\x02Q\x12O/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}/customModels\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8b\x02\n#com.google.cloud.discoveryengine.v1B\x18SearchTuningServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.CustomTuningModel", "google/cloud/discoveryengine/v1/custom_tuning_model.proto"], + ["google.cloud.discoveryengine.v1.ImportErrorConfig", "google/cloud/discoveryengine/v1/import_config.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + ListCustomModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCustomModelsRequest").msgclass + ListCustomModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCustomModelsResponse").msgclass + TrainCustomModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelRequest").msgclass + TrainCustomModelRequest::GcsTrainingInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInput").msgclass + TrainCustomModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelResponse").msgclass + TrainCustomModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb new file mode 100644 index 000000000000..00bbc3467de9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/search_tuning_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/search_tuning_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SearchTuningService + # Service for search tuning. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.SearchTuningService' + + # Trains a custom model. + rpc :TrainCustomModel, ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Google::Longrunning::Operation + # Gets a list of all the custom models. + rpc :ListCustomModels, ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb new file mode 100644 index 000000000000..3cfca5b246b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/serving_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/common_pb' +require 'google/cloud/discoveryengine/v1/search_service_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/discoveryengine/v1/serving_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfc\x0b\n\rServingConfig\x12R\n\x0cmedia_config\x18\x07 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.ServingConfig.MediaConfigH\x00\x12V\n\x0egeneric_config\x18\n \x01(\x0b\x32<.google.cloud.discoveryengine.v1.ServingConfig.GenericConfigH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12L\n\rsolution_type\x18\x03 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x10\n\x08model_id\x18\x04 \x01(\t\x12\x17\n\x0f\x64iversity_level\x18\x05 \x01(\t\x12\x1a\n\x12ranking_expression\x18\x15 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\x12\x66ilter_control_ids\x18\x0b \x03(\t\x12\x19\n\x11\x62oost_control_ids\x18\x0c \x03(\t\x12\x1c\n\x14redirect_control_ids\x18\x0e \x03(\t\x12\x1c\n\x14synonyms_control_ids\x18\x0f \x03(\t\x12#\n\x1boneway_synonyms_control_ids\x18\x10 \x03(\t\x12\x1e\n\x16\x64issociate_control_ids\x18\x11 \x03(\t\x12\x1f\n\x17replacement_control_ids\x18\x12 \x03(\t\x12\x1a\n\x12ignore_control_ids\x18\x13 \x03(\t\x12\x1b\n\x13promote_control_ids\x18\x1a \x03(\t\x1a\xf7\x01\n\x0bMediaConfig\x12.\n$content_watched_percentage_threshold\x18\x02 \x01(\x02H\x00\x12+\n!content_watched_seconds_threshold\x18\x05 \x01(\x02H\x00\x12\x1b\n\x13\x64\x65motion_event_type\x18\x01 \x01(\t\x12-\n demote_content_watched_past_days\x18% \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x1d\x63ontent_freshness_cutoff_days\x18\x04 \x01(\x05\x42\x18\n\x16\x64\x65mote_content_watched\x1an\n\rGenericConfig\x12]\n\x13\x63ontent_search_spec\x18\x01 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec:\x80\x03\xea\x41\xfc\x02\n,discoveryengine.googleapis.com/ServingConfig\x12_projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}\x12xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}\x12qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}B\x11\n\x0fvertical_configB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12ServingConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec", "google/cloud/discoveryengine/v1/search_service.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + ServingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig").msgclass + ServingConfig::MediaConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig.MediaConfig").msgclass + ServingConfig::GenericConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig.GenericConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb new file mode 100644 index 000000000000..88ded488a0c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/serving_config_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/serving_config_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n.google.cloud.discoveryengine.v1.Session.Turn.QueryConfigEntryB\x03\xe0\x41\x01\x1a\x32\n\x10QueryConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01:\xe6\x02\xea\x41\xe2\x02\n&discoveryengine.googleapis.com/Session\x12Rprojects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}\x12kprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}\x12\x64projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}*\x08sessions2\x07session\"9\n\x05Query\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x12\x15\n\x08query_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x42\t\n\x07\x63ontentB\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0cSessionProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.Answer", "google/cloud/discoveryengine/v1/answer.proto"], + ["google.cloud.discoveryengine.v1.AssistAnswer", "google/cloud/discoveryengine/v1/assist_answer.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + Session = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session").msgclass + Session::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session.Turn").msgclass + Session::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session.State").enummodule + Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Query").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb new file mode 100644 index 000000000000..14561db3cfb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/session_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/conversational_search_service_pb' +require 'google/cloud/discoveryengine/v1/session_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n5google/cloud/discoveryengine/v1/session_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x43google/cloud/discoveryengine/v1/conversational_search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\x1a\x1bgoogle/protobuf/empty.proto2\xda\x0e\n\x0eSessionService\x12\xf4\x02\n\rCreateSession\x12\x35.google.cloud.discoveryengine.v1.CreateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x81\x02\xda\x41\x0eparent,session\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/sessions:\x07sessionZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions:\x07sessionZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions:\x07session\x12\xbd\x02\n\rDeleteSession\x12\x35.google.cloud.discoveryengine.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\x91\x03\n\rUpdateSession\x12\x35.google.cloud.discoveryengine.v1.UpdateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x9e\x02\xda\x41\x13session,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{session.name=projects/*/locations/*/dataStores/*/sessions/*}:\x07sessionZZ2O/v1/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}:\x07sessionZW2L/v1/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}:\x07session\x12\xc9\x02\n\nGetSession\x12\x32.google.cloud.discoveryengine.v1.GetSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\xdc\x02\n\x0cListSessions\x12\x34.google.cloud.discoveryengine.v1.ListSessionsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListSessionsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/sessionsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessionsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13SessionServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb new file mode 100644 index 000000000000..652682c6b529 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/session_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/session_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SessionService + # Service for managing Sessions and Session-related resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.SessionService' + + # Creates a Session. + # + # If the [Session][google.cloud.discoveryengine.v1.Session] to create already + # exists, an ALREADY_EXISTS error is returned. + rpc :CreateSession, ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Deletes a Session. + # + # If the [Session][google.cloud.discoveryengine.v1.Session] to delete does + # not exist, a NOT_FOUND error is returned. + rpc :DeleteSession, ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Google::Protobuf::Empty + # Updates a Session. + # + # [Session][google.cloud.discoveryengine.v1.Session] action type cannot be + # changed. If the [Session][google.cloud.discoveryengine.v1.Session] to + # update does not exist, a NOT_FOUND error is returned. + rpc :UpdateSession, ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Gets a Session. + rpc :GetSession, ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session + # Lists all Sessions by their parent + # [DataStore][google.cloud.discoveryengine.v1.DataStore]. + rpc :ListSessions, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb new file mode 100644 index 000000000000..d625b1812b46 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/site_search_engine.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/discoveryengine/v1/site_search_engine.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x95\x02\n\x10SiteSearchEngine\x12\x0c\n\x04name\x18\x01 \x01(\t:\xf2\x01\xea\x41\xee\x01\n/discoveryengine.googleapis.com/SiteSearchEngine\x12Pprojects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine\x12iprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine\"\xb7\t\n\nTargetSite\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12$\n\x14provided_uri_pattern\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12>\n\x04type\x18\x03 \x01(\x0e\x32\x30.google.cloud.discoveryengine.v1.TargetSite.Type\x12\x18\n\x0b\x65xact_match\x18\x06 \x01(\x08\x42\x03\xe0\x41\x05\x12\"\n\x15generated_uri_pattern\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0froot_domain_uri\x18\n \x01(\tB\x03\xe0\x41\x03\x12Z\n\x16site_verification_info\x18\x07 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.SiteVerificationInfoB\x03\xe0\x41\x03\x12X\n\x0findexing_status\x18\x08 \x01(\x0e\x32:.google.cloud.discoveryengine.v1.TargetSite.IndexingStatusB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x0e\x66\x61ilure_reason\x18\t \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.TargetSite.FailureReasonB\x03\xe0\x41\x03\x1a\xa9\x01\n\rFailureReason\x12_\n\rquota_failure\x18\x01 \x01(\x0b\x32\x46.google.cloud.discoveryengine.v1.TargetSite.FailureReason.QuotaFailureH\x00\x1a,\n\x0cQuotaFailure\x12\x1c\n\x14total_required_quota\x18\x01 \x01(\x03\x42\t\n\x07\x66\x61ilure\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INCLUDE\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02\"\x87\x01\n\x0eIndexingStatus\x12\x1f\n\x1bINDEXING_STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0b\x43\x41NCELLABLE\x10\x05\x12\r\n\tCANCELLED\x10\x06:\xa1\x02\xea\x41\x9d\x02\n)discoveryengine.googleapis.com/TargetSite\x12jprojects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}\x12\x83\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}\"\xa3\x02\n\x14SiteVerificationInfo\x12l\n\x17site_verification_state\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SiteVerificationInfo.SiteVerificationState\x12/\n\x0bverify_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"l\n\x15SiteVerificationState\x12\'\n#SITE_VERIFICATION_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERIFIED\x10\x01\x12\x0e\n\nUNVERIFIED\x10\x02\x12\x0c\n\x08\x45XEMPTED\x10\x03\"\xfb\x02\n\x07Sitemap\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x8f\x02\xea\x41\x8b\x02\n&discoveryengine.googleapis.com/Sitemap\x12\x63projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}\x12|projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}B\x06\n\x04\x66\x65\x65\x64\x42\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15SiteSearchEngineProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + SiteSearchEngine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteSearchEngine").msgclass + TargetSite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite").msgclass + TargetSite::FailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.FailureReason").msgclass + TargetSite::FailureReason::QuotaFailure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.FailureReason.QuotaFailure").msgclass + TargetSite::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.Type").enummodule + TargetSite::IndexingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.IndexingStatus").enummodule + SiteVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteVerificationInfo").msgclass + SiteVerificationInfo::SiteVerificationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteVerificationInfo.SiteVerificationState").enummodule + Sitemap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Sitemap").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb new file mode 100644 index 000000000000..099050a4ed37 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/site_search_engine_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/site_search_engine_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n@google/cloud/discoveryengine/v1/site_search_engine_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/discoveryengine/v1/site_search_engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"c\n\x1aGetSiteSearchEngineRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"\xa9\x01\n\x17\x43reateTargetSiteRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x45\n\x0btarget_site\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSiteB\x03\xe0\x41\x02\"|\n\x18\x43reateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb9\x01\n\x1d\x42\x61tchCreateTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12O\n\x08requests\x18\x02 \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.CreateTargetSiteRequestB\x03\xe0\x41\x02\"W\n\x14GetTargetSiteRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/TargetSite\"`\n\x17UpdateTargetSiteRequest\x12\x45\n\x0btarget_site\x18\x01 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSiteB\x03\xe0\x41\x02\"|\n\x18UpdateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\x17\x44\x65leteTargetSiteRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/TargetSite\"|\n\x18\x44\x65leteTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x88\x01\n\x16ListTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n\x17ListTargetSitesResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x81\x01\n\x1d\x42\x61tchCreateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"c\n\x1e\x42\x61tchCreateTargetSitesResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\"\x9f\x01\n\x14\x43reateSitemapRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12>\n\x07sitemap\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SitemapB\x03\xe0\x41\x02\"T\n\x14\x44\x65leteSitemapRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Sitemap\"\xc2\x02\n\x14\x46\x65tchSitemapsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12S\n\x07matcher\x18\x02 \x01(\x0b\x32=.google.cloud.discoveryengine.v1.FetchSitemapsRequest.MatcherB\x03\xe0\x41\x01\x1a\x1b\n\x0bUrisMatcher\x12\x0c\n\x04uris\x18\x01 \x03(\t\x1ao\n\x07Matcher\x12Y\n\x0curis_matcher\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.FetchSitemapsRequest.UrisMatcherH\x00\x42\t\n\x07matcher\"y\n\x15\x43reateSitemapMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"y\n\x15\x44\x65leteSitemapMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc8\x01\n\x15\x46\x65tchSitemapsResponse\x12\x61\n\x11sitemaps_metadata\x18\x01 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.FetchSitemapsResponse.SitemapMetadata\x1aL\n\x0fSitemapMetadata\x12\x39\n\x07sitemap\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.Sitemap\"v\n\x1f\x45nableAdvancedSiteSearchRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"\"\n EnableAdvancedSiteSearchResponse\"\x84\x01\n EnableAdvancedSiteSearchMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"w\n DisableAdvancedSiteSearchRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"#\n!DisableAdvancedSiteSearchResponse\"\x85\x01\n!DisableAdvancedSiteSearchMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9a\x01\n\x12RecrawlUrisRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\x04uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1c\n\x0fsite_credential\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xe8\x03\n\x13RecrawlUrisResponse\x12Y\n\x0f\x66\x61ilure_samples\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo\x12\x13\n\x0b\x66\x61iled_uris\x18\x02 \x03(\t\x1a\xe0\x02\n\x0b\x46\x61ilureInfo\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12g\n\x0f\x66\x61ilure_reasons\x18\x02 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason\x1a\xda\x01\n\rFailureReason\x12n\n\x0b\x63orpus_type\x18\x01 \x01(\x0e\x32Y.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType\x12\x15\n\rerror_message\x18\x02 \x01(\t\"B\n\nCorpusType\x12\x1b\n\x17\x43ORPUS_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45SKTOP\x10\x01\x12\n\n\x06MOBILE\x10\x02\"\x97\x03\n\x13RecrawlUrisMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cinvalid_uris\x18\x03 \x03(\t\x12\x1a\n\x12invalid_uris_count\x18\x08 \x01(\x05\x12\x14\n\x0cnoindex_uris\x18\x0b \x03(\t\x12\x1a\n\x12noindex_uris_count\x18\x0c \x01(\x05\x12&\n\x1euris_not_matching_target_sites\x18\t \x03(\t\x12,\n$uris_not_matching_target_sites_count\x18\n \x01(\x05\x12\x18\n\x10valid_uris_count\x18\x04 \x01(\x05\x12\x15\n\rsuccess_count\x18\x05 \x01(\x05\x12\x15\n\rpending_count\x18\x06 \x01(\x05\x12\x1c\n\x14quota_exceeded_count\x18\x07 \x01(\x05\"h\n\x1d\x42\x61tchVerifyTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\" \n\x1e\x42\x61tchVerifyTargetSitesResponse\"\x82\x01\n\x1e\x42\x61tchVerifyTargetSitesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa2\x01\n$FetchDomainVerificationStatusRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x97\x01\n%FetchDomainVerificationStatusResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x32\x8f/\n\x17SiteSearchEngineService\x12\xa8\x02\n\x13GetSiteSearchEngine\x12;.google.cloud.discoveryengine.v1.GetSiteSearchEngineRequest\x1a\x31.google.cloud.discoveryengine.v1.SiteSearchEngine\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01\x12?/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine}ZO\x12M/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}\x12\xbb\x03\n\x10\x43reateTargetSite\x12\x38.google.cloud.discoveryengine.v1.CreateTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\xcd\x02\xca\x41\x66\n*google.cloud.discoveryengine.v1.TargetSite\x12\x38google.cloud.discoveryengine.v1.CreateTargetSiteMetadata\xda\x41\x12parent,target_site\x82\xd3\xe4\x93\x02\xc8\x01\"M/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSites:\x0btarget_siteZj\"[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites:\x0btarget_site\x12\xcf\x03\n\x16\x42\x61tchCreateTargetSites\x12>.google.cloud.discoveryengine.v1.BatchCreateTargetSitesRequest\x1a\x1d.google.longrunning.Operation\"\xd5\x02\xca\x41\x7f\n>google.cloud.discoveryengine.v1.BatchCreateTargetSitesResponse\x12=google.cloud.discoveryengine.v1.BatchCreateTargetSiteMetadata\x82\xd3\xe4\x93\x02\xcc\x01\"Y/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSites:batchCreate:\x01*Zl\"g/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites:batchCreate:\x01*\x12\xb2\x02\n\rGetTargetSite\x12\x35.google.cloud.discoveryengine.v1.GetTargetSiteRequest\x1a+.google.cloud.discoveryengine.v1.TargetSite\"\xbc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xae\x01\x12M/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}Z]\x12[/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}\x12\xcc\x03\n\x10UpdateTargetSite\x12\x38.google.cloud.discoveryengine.v1.UpdateTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\xde\x02\xca\x41\x66\n*google.cloud.discoveryengine.v1.TargetSite\x12\x38google.cloud.discoveryengine.v1.UpdateTargetSiteMetadata\xda\x41\x0btarget_site\x82\xd3\xe4\x93\x02\xe0\x01\x32Y/v1/{target_site.name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}:\x0btarget_siteZv2g/v1/{target_site.name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}:\x0btarget_site\x12\xfe\x02\n\x10\x44\x65leteTargetSite\x12\x38.google.cloud.discoveryengine.v1.DeleteTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\x90\x02\xca\x41Q\n\x15google.protobuf.Empty\x12\x38google.cloud.discoveryengine.v1.DeleteTargetSiteMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xae\x01*M/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}Z]*[/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}\x12\xc5\x02\n\x0fListTargetSites\x12\x37.google.cloud.discoveryengine.v1.ListTargetSitesRequest\x1a\x38.google.cloud.discoveryengine.v1.ListTargetSitesResponse\"\xbe\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xae\x01\x12M/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSitesZ]\x12[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites\x12\x9d\x03\n\rCreateSitemap\x12\x35.google.cloud.discoveryengine.v1.CreateSitemapRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x02\xca\x41`\n\'google.cloud.discoveryengine.v1.Sitemap\x12\x35google.cloud.discoveryengine.v1.CreateSitemapMetadata\xda\x41\x0eparent,sitemap\x82\xd3\xe4\x93\x02\xba\x01\"J/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/sitemaps:\x07sitemapZc\"X/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/sitemaps:\x07sitemap\x12\xef\x02\n\rDeleteSitemap\x12\x35.google.cloud.discoveryengine.v1.DeleteSitemapRequest\x1a\x1d.google.longrunning.Operation\"\x87\x02\xca\x41N\n\x15google.protobuf.Empty\x12\x35google.cloud.discoveryengine.v1.DeleteSitemapMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa8\x01*J/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/sitemaps/*}ZZ*X/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/sitemaps/*}\x12\xc5\x02\n\rFetchSitemaps\x12\x35.google.cloud.discoveryengine.v1.FetchSitemapsRequest\x1a\x36.google.cloud.discoveryengine.v1.FetchSitemapsResponse\"\xc4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb4\x01\x12P/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/sitemaps:fetchZ`\x12^/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/sitemaps:fetch\x12\xf3\x03\n\x18\x45nableAdvancedSiteSearch\x12@.google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x02\xca\x41\x84\x01\n@google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchResponse\x12@google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchMetadata\x82\xd3\xe4\x93\x02\xe6\x01\"f/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:enableAdvancedSiteSearch:\x01*Zy\"t/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:enableAdvancedSiteSearch:\x01*\x12\xf9\x03\n\x19\x44isableAdvancedSiteSearch\x12\x41.google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x02\xca\x41\x86\x01\nAgoogle.cloud.discoveryengine.v1.DisableAdvancedSiteSearchResponse\x12\x41google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchMetadata\x82\xd3\xe4\x93\x02\xe8\x01\"g/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:disableAdvancedSiteSearch:\x01*Zz\"u/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:disableAdvancedSiteSearch:\x01*\x12\xa4\x03\n\x0bRecrawlUris\x12\x33.google.cloud.discoveryengine.v1.RecrawlUrisRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x02\xca\x41j\n3google.cloud.discoveryengine.v1.RecrawlUrisResponse\x12\x33google.cloud.discoveryengine.v1.RecrawlUrisMetadata\x82\xd3\xe4\x93\x02\xcc\x01\"Y/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:recrawlUris:\x01*Zl\"g/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:recrawlUris:\x01*\x12\xef\x02\n\x16\x42\x61tchVerifyTargetSites\x12>.google.cloud.discoveryengine.v1.BatchVerifyTargetSitesRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x01\xca\x41\x80\x01\n>google.cloud.discoveryengine.v1.BatchVerifyTargetSitesResponse\x12>google.cloud.discoveryengine.v1.BatchVerifyTargetSitesMetadata\x82\xd3\xe4\x93\x02k\"f/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:batchVerifyTargetSites:\x01*\x12\xb2\x02\n\x1d\x46\x65tchDomainVerificationStatus\x12\x45.google.cloud.discoveryengine.v1.FetchDomainVerificationStatusRequest\x1a\x46.google.cloud.discoveryengine.v1.FetchDomainVerificationStatusResponse\"\x81\x01\x82\xd3\xe4\x93\x02{\x12y/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:fetchDomainVerificationStatus\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8f\x02\n#com.google.cloud.discoveryengine.v1B\x1cSiteSearchEngineServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.TargetSite", "google/cloud/discoveryengine/v1/site_search_engine.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + GetSiteSearchEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetSiteSearchEngineRequest").msgclass + CreateTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateTargetSiteRequest").msgclass + CreateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateTargetSiteMetadata").msgclass + BatchCreateTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSitesRequest").msgclass + GetTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetTargetSiteRequest").msgclass + UpdateTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateTargetSiteRequest").msgclass + UpdateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateTargetSiteMetadata").msgclass + DeleteTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteTargetSiteRequest").msgclass + DeleteTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteTargetSiteMetadata").msgclass + ListTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListTargetSitesRequest").msgclass + ListTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListTargetSitesResponse").msgclass + BatchCreateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSiteMetadata").msgclass + BatchCreateTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSitesResponse").msgclass + CreateSitemapRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSitemapRequest").msgclass + DeleteSitemapRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSitemapRequest").msgclass + FetchSitemapsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest").msgclass + FetchSitemapsRequest::UrisMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest.UrisMatcher").msgclass + FetchSitemapsRequest::Matcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest.Matcher").msgclass + CreateSitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSitemapMetadata").msgclass + DeleteSitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSitemapMetadata").msgclass + FetchSitemapsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsResponse").msgclass + FetchSitemapsResponse::SitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsResponse.SitemapMetadata").msgclass + EnableAdvancedSiteSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchRequest").msgclass + EnableAdvancedSiteSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchResponse").msgclass + EnableAdvancedSiteSearchMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchMetadata").msgclass + DisableAdvancedSiteSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchRequest").msgclass + DisableAdvancedSiteSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchResponse").msgclass + DisableAdvancedSiteSearchMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchMetadata").msgclass + RecrawlUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisRequest").msgclass + RecrawlUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse").msgclass + RecrawlUrisResponse::FailureInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo").msgclass + RecrawlUrisResponse::FailureInfo::FailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason").msgclass + RecrawlUrisResponse::FailureInfo::FailureReason::CorpusType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType").enummodule + RecrawlUrisMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisMetadata").msgclass + BatchVerifyTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesRequest").msgclass + BatchVerifyTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesResponse").msgclass + BatchVerifyTargetSitesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesMetadata").msgclass + FetchDomainVerificationStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchDomainVerificationStatusRequest").msgclass + FetchDomainVerificationStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchDomainVerificationStatusResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb new file mode 100644 index 000000000000..aba02bad853b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb @@ -0,0 +1,80 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/site_search_engine_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/site_search_engine_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module SiteSearchEngineService + # Service for managing site search related resources. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.SiteSearchEngineService' + + # Gets the + # [SiteSearchEngine][google.cloud.discoveryengine.v1.SiteSearchEngine]. + rpc :GetSiteSearchEngine, ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine + # Creates a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. + rpc :CreateTargetSite, ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Google::Longrunning::Operation + # Creates [TargetSite][google.cloud.discoveryengine.v1.TargetSite] in a + # batch. + rpc :BatchCreateTargetSites, ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Google::Longrunning::Operation + # Gets a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. + rpc :GetTargetSite, ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Google::Cloud::DiscoveryEngine::V1::TargetSite + # Updates a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. + rpc :UpdateTargetSite, ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Google::Longrunning::Operation + # Deletes a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. + rpc :DeleteTargetSite, ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Google::Longrunning::Operation + # Gets a list of [TargetSite][google.cloud.discoveryengine.v1.TargetSite]s. + rpc :ListTargetSites, ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse + # Creates a [Sitemap][google.cloud.discoveryengine.v1.Sitemap]. + rpc :CreateSitemap, ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Google::Longrunning::Operation + # Deletes a [Sitemap][google.cloud.discoveryengine.v1.Sitemap]. + rpc :DeleteSitemap, ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Google::Longrunning::Operation + # Fetch [Sitemap][google.cloud.discoveryengine.v1.Sitemap]s in a + # [DataStore][google.cloud.discoveryengine.v1.DataStore]. + rpc :FetchSitemaps, ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse + # Upgrade from basic site search to advanced site search. + rpc :EnableAdvancedSiteSearch, ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Google::Longrunning::Operation + # Downgrade from advanced site search to basic site search. + rpc :DisableAdvancedSiteSearch, ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Google::Longrunning::Operation + # Request on-demand recrawl for a list of URIs. + rpc :RecrawlUris, ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Google::Longrunning::Operation + # Verify target sites' ownership and validity. + # This API sends all the target sites under site search engine for + # verification. + rpc :BatchVerifyTargetSites, ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Google::Longrunning::Operation + # Returns list of target sites with its domain verification status. + # This method can only be called under data store with BASIC_SITE_SEARCH + # state at the moment. + rpc :FetchDomainVerificationStatus, ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb new file mode 100644 index 000000000000..c9cb80206ee7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/user_event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/common_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/discoveryengine/v1/user_event.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\t\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversion_type\x18\x15 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0euser_pseudo_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06\x65ngine\x18\x13 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\x12\x41\n\ndata_store\x18\x14 \x01(\tB-\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12.\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\tuser_info\x18\x04 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x1b\n\x13\x64irect_user_request\x18\x05 \x01(\x08\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12<\n\tpage_info\x18\x07 \x01(\x0b\x32).google.cloud.discoveryengine.v1.PageInfo\x12\x19\n\x11\x61ttribution_token\x18\x08 \x01(\t\x12\x0e\n\x06\x66ilter\x18\t \x01(\t\x12@\n\tdocuments\x18\n \x03(\x0b\x32-.google.cloud.discoveryengine.v1.DocumentInfo\x12\x39\n\x05panel\x18\x0b \x01(\x0b\x32*.google.cloud.discoveryengine.v1.PanelInfo\x12@\n\x0bsearch_info\x18\x0c \x01(\x0b\x32+.google.cloud.discoveryengine.v1.SearchInfo\x12H\n\x0f\x63ompletion_info\x18\r \x01(\x0b\x32/.google.cloud.discoveryengine.v1.CompletionInfo\x12J\n\x10transaction_info\x18\x0e \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.TransactionInfo\x12\x0f\n\x07tag_ids\x18\x0f \x03(\t\x12\x15\n\rpromotion_ids\x18\x10 \x03(\t\x12N\n\nattributes\x18\x11 \x03(\x0b\x32:.google.cloud.discoveryengine.v1.UserEvent.AttributesEntry\x12>\n\nmedia_info\x18\x12 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.MediaInfo\x12?\n\x06panels\x18\x16 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.PanelInfoB\x03\xe0\x41\x01\x1a\x63\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.CustomAttribute:\x02\x38\x01\"Y\n\x08PageInfo\x12\x13\n\x0bpageview_id\x18\x01 \x01(\t\x12\x15\n\rpage_category\x18\x02 \x01(\t\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x14\n\x0creferrer_uri\x18\x04 \x01(\t\"T\n\nSearchInfo\x12\x14\n\x0csearch_query\x18\x01 \x01(\t\x12\x10\n\x08order_by\x18\x02 \x01(\t\x12\x13\n\x06offset\x18\x03 \x01(\x05H\x00\x88\x01\x01\x42\t\n\x07_offset\"H\n\x0e\x43ompletionInfo\x12\x1b\n\x13selected_suggestion\x18\x01 \x01(\t\x12\x19\n\x11selected_position\x18\x02 \x01(\x05\"\xc9\x01\n\x0fTransactionInfo\x12\x17\n\x05value\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0etransaction_id\x18\x03 \x01(\t\x12\x10\n\x03tax\x18\x04 \x01(\x02H\x01\x88\x01\x01\x12\x11\n\x04\x63ost\x18\x05 \x01(\x02H\x02\x88\x01\x01\x12\x1b\n\x0e\x64iscount_value\x18\x06 \x01(\x02H\x03\x88\x01\x01\x42\x08\n\x06_valueB\x06\n\x04_taxB\x07\n\x05_costB\x11\n\x0f_discount_value\"\x89\x02\n\x0c\x44ocumentInfo\x12\x0c\n\x02id\x18\x01 \x01(\tH\x00\x12<\n\x04name\x18\x02 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x12\x15\n\x08quantity\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\rpromotion_ids\x18\x04 \x03(\t\x12\x13\n\x06joined\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\"\n\x10\x63onversion_value\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13\x64ocument_descriptorB\x0b\n\t_quantityB\x13\n\x11_conversion_value\"\xdb\x01\n\tPanelInfo\x12\x15\n\x08panel_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x1b\n\x0epanel_position\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x19\n\x0ctotal_panels\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x45\n\tdocuments\x18\x06 \x03(\x0b\x32-.google.cloud.discoveryengine.v1.DocumentInfoB\x03\xe0\x41\x01\x42\x11\n\x0f_panel_positionB\x0f\n\r_total_panels\"\x8d\x01\n\tMediaInfo\x12:\n\x17media_progress_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12&\n\x19media_progress_percentage\x18\x02 \x01(\x02H\x00\x88\x01\x01\x42\x1c\n\x1a_media_progress_percentageB\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0eUserEventProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.discoveryengine.v1.UserInfo", "google/cloud/discoveryengine/v1/common.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserEvent").msgclass + PageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PageInfo").msgclass + SearchInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchInfo").msgclass + CompletionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompletionInfo").msgclass + TransactionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TransactionInfo").msgclass + DocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentInfo").msgclass + PanelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PanelInfo").msgclass + MediaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.MediaInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb new file mode 100644 index 000000000000..7304fc75125a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/user_event_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/import_config_pb' +require 'google/cloud/discoveryengine/v1/purge_config_pb' +require 'google/cloud/discoveryengine/v1/user_event_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n8google/cloud/discoveryengine/v1/user_event_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a\x30google/cloud/discoveryengine/v1/user_event.proto\x1a#google/longrunning/operations.proto\"\xc7\x01\n\x15WriteUserEventRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\nuser_event\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.UserEventB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x13\n\x0bwrite_async\x18\x03 \x01(\x08\x42\r\n\x0b_user_event\"\xa8\x01\n\x17\x43ollectUserEventRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03\x65ts\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x06\n\x04_uriB\x06\n\x04_ets2\xec\x0c\n\x10UserEventService\x12\xf0\x02\n\x0eWriteUserEvent\x12\x36.google.cloud.discoveryengine.v1.WriteUserEventRequest\x1a*.google.cloud.discoveryengine.v1.UserEvent\"\xf9\x01\x82\xd3\xe4\x93\x02\xf2\x01\"A/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write:\nuser_eventZ]\"O/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write:\nuser_eventZB\"4/v1/{parent=projects/*/locations/*}/userEvents:write:\nuser_event\x12\xc0\x02\n\x10\x43ollectUserEvent\x12\x38.google.cloud.discoveryengine.v1.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"\xdb\x01\x82\xd3\xe4\x93\x02\xd4\x01\x12\x43/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collectZS\x12Q/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collectZ8\x12\x36/v1/{parent=projects/*/locations/*}/userEvents:collect\x12\x84\x03\n\x0fPurgeUserEvents\x12\x37.google.cloud.discoveryengine.v1.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x98\x02\xca\x41r\n7google.cloud.discoveryengine.v1.PurgeUserEventsResponse\x12\x37google.cloud.discoveryengine.v1.PurgeUserEventsMetadata\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:purge:\x01*ZT\"O/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:purge:\x01*\x12\xc6\x03\n\x10ImportUserEvents\x12\x38.google.cloud.discoveryengine.v1.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x02\xca\x41t\n8google.cloud.discoveryengine.v1.ImportUserEventsResponse\x12\x38google.cloud.discoveryengine.v1.ImportUserEventsMetadata\x82\xd3\xe4\x93\x02\xda\x01\"B/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import:\x01*ZU\"P/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import:\x01*Z:\"5/v1/{parent=projects/*/locations/*}/userEvents:import:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15UserEventServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.UserEvent", "google/cloud/discoveryengine/v1/user_event.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WriteUserEventRequest").msgclass + CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CollectUserEventRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb new file mode 100644 index 000000000000..1d36aa174fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/user_event_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/user_event_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserEventService + # Service for ingesting end user actions on a website to Discovery Engine API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.UserEventService' + + # Writes a single user event. + rpc :WriteUserEvent, ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Google::Cloud::DiscoveryEngine::V1::UserEvent + # 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, ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Google::Api::HttpBody + # 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, ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Google::Longrunning::Operation + # 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, ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb new file mode 100644 index 000000000000..48d43125af75 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/user_license.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/discoveryengine/v1/user_license.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbb\x04\n\x0bUserLicense\x12\x1e\n\x0euser_principal\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x19\n\x0cuser_profile\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12j\n\x18license_assignment_state\x18\x04 \x01(\x0e\x32\x43.google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentStateB\x03\xe0\x41\x03\x12L\n\x0elicense_config\x18\x05 \x01(\tB4\xe0\x41\x01\xfa\x41.\n,discoveryengine.googleapis.com/LicenseConfig\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x0flast_login_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x90\x01\n\x16LicenseAssignmentState\x12(\n$LICENSE_ASSIGNMENT_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41SSIGNED\x10\x01\x12\x0e\n\nUNASSIGNED\x10\x02\x12\x0e\n\nNO_LICENSE\x10\x03\x12\x1e\n\x1aNO_LICENSE_ATTEMPTED_LOGIN\x10\x04\x42\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10UserLicenseProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + UserLicense = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserLicense").msgclass + UserLicense::LicenseAssignmentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb new file mode 100644 index 000000000000..731bd218da25 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/discoveryengine/v1/user_license_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/discoveryengine/v1/user_license_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/cloud/discoveryengine/v1/user_license_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/discoveryengine/v1/user_license.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa1\x01\n\x17ListUserLicensesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/UserStore\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"x\n\x18ListUserLicensesResponse\x12\x43\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicense\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x03\n\x1e\x42\x61tchUpdateUserLicensesRequest\x12\x65\n\rinline_source\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest.InlineSourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/UserStore\x12,\n\x1f\x64\x65lete_unassigned_user_licenses\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x8e\x01\n\x0cInlineSource\x12H\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicenseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x42\x08\n\x06source\"\xb1\x01\n\x1f\x42\x61tchUpdateUserLicensesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"\x91\x01\n\x1f\x42\x61tchUpdateUserLicensesResponse\x12\x43\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicense\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status2\x9a\x05\n\x12UserLicenseService\x12\xd7\x01\n\x10ListUserLicenses\x12\x38.google.cloud.discoveryengine.v1.ListUserLicensesRequest\x1a\x39.google.cloud.discoveryengine.v1.ListUserLicensesResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/userStores/*}/userLicenses\x12\xd5\x02\n\x17\x42\x61tchUpdateUserLicenses\x12?.google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x01\xca\x41\x82\x01\n?google.cloud.discoveryengine.v1.BatchUpdateUserLicensesResponse\x12?google.cloud.discoveryengine.v1.BatchUpdateUserLicensesMetadata\x82\xd3\xe4\x93\x02M\"H/v1/{parent=projects/*/locations/*/userStores/*}:batchUpdateUserLicenses:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8a\x02\n#com.google.cloud.discoveryengine.v1B\x17UserLicenseServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.discoveryengine.v1.UserLicense", "google/cloud/discoveryengine/v1/user_license.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module DiscoveryEngine + module V1 + ListUserLicensesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListUserLicensesRequest").msgclass + ListUserLicensesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListUserLicensesResponse").msgclass + BatchUpdateUserLicensesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest").msgclass + BatchUpdateUserLicensesRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest.InlineSource").msgclass + BatchUpdateUserLicensesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesMetadata").msgclass + BatchUpdateUserLicensesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb new file mode 100644 index 000000000000..4991b3aec63d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/discoveryengine/v1/user_license_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# + +require 'grpc' +require 'google/cloud/discoveryengine/v1/user_license_service_pb' + +module Google + module Cloud + module DiscoveryEngine + module V1 + module UserLicenseService + # Service for managing User Licenses. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.discoveryengine.v1.UserLicenseService' + + # Lists the User Licenses. + rpc :ListUserLicenses, ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse + # Updates the User License. + # This method is used for batch assign/unassign licenses to users. + rpc :BatchUpdateUserLicenses, ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md new file mode 100644 index 000000000000..ce0aac5f06a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Discovery Engine V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..938f7ac6b2fd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Message that represents an arbitrary HTTP body. It should only be used for + # payload formats that can't be represented as JSON, such as raw binary or + # an HTML page. + # + # + # This message can be used both in streaming and non-streaming API methods in + # the request as well as the response. + # + # It can be used as a top-level request field, which is convenient if one + # wants to extract parameters from either the URL or HTTP template into the + # request fields and also want access to the raw HTTP body. + # + # Example: + # + # message GetResourceRequest { + # // A unique request id. + # string request_id = 1; + # + # // The raw HTTP body is bound to this field. + # google.api.HttpBody http_body = 2; + # + # } + # + # service ResourceService { + # rpc GetResource(GetResourceRequest) + # returns (google.api.HttpBody); + # rpc UpdateResource(google.api.HttpBody) + # returns (google.protobuf.Empty); + # + # } + # + # Example with streaming methods: + # + # service CaldavService { + # rpc GetCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # rpc UpdateCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # + # } + # + # Use of this type only changes how the request and response bodies are + # handled, all other features will continue to work unchanged. + # @!attribute [rw] content_type + # @return [::String] + # The HTTP Content-Type header value specifying the content type of the body. + # @!attribute [rw] data + # @return [::String] + # The HTTP request/response body as raw binary. + # @!attribute [rw] extensions + # @return [::Array<::Google::Protobuf::Any>] + # Application specific response metadata. Must be set in the first response + # for streaming APIs. + class HttpBody + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb new file mode 100644 index 000000000000..4523dacde51a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Defines an answer. + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::State] + # The state of the answer generation. + # @!attribute [rw] answer_text + # @return [::String] + # The textual answer. + # @!attribute [rw] grounding_score + # @return [::Float] + # A score in the range of [0, 1] describing how grounded the answer is by the + # reference chunks. + # @!attribute [rw] citations + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Citation>] + # Citations. + # @!attribute [rw] grounding_supports + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::GroundingSupport>] + # Optional. Grounding supports. + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Reference>] + # References. + # @!attribute [rw] related_questions + # @return [::Array<::String>] + # Suggested related questions. + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step>] + # Answer generation steps. + # @!attribute [rw] query_understanding_info + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo] + # Query understanding information. + # @!attribute [rw] answer_skipped_reasons + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::AnswerSkippedReason>] + # Additional answer-skipped reasons. This provides the reason for ignored + # cases. If nothing is skipped, this field is not set. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Answer creation timestamp. + # @!attribute [r] complete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Answer completed timestamp. + # @!attribute [rw] safety_ratings + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SafetyRating>] + # Optional. Safety ratings. + class Answer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Citation info for a segment. + # @!attribute [rw] start_index + # @return [::Integer] + # Index indicates the start of the segment, measured in bytes (UTF-8 + # unicode). If there are multi-byte characters,such as non-ASCII + # characters, the index measurement is longer than the string length. + # @!attribute [rw] end_index + # @return [::Integer] + # End of the attributed segment, exclusive. Measured in bytes (UTF-8 + # unicode). If there are multi-byte characters,such as non-ASCII + # characters, the index measurement is longer than the string length. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::CitationSource>] + # Citation sources for the attributed segment. + class Citation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Citation source. + # @!attribute [rw] reference_id + # @return [::String] + # ID of the citation source. + class CitationSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Grounding support for a claim in `answer_text`. + # @!attribute [rw] start_index + # @return [::Integer] + # Required. Index indicates the start of the claim, measured in bytes + # (UTF-8 unicode). + # @!attribute [rw] end_index + # @return [::Integer] + # Required. End of the claim, exclusive. + # @!attribute [rw] grounding_score + # @return [::Float] + # A score in the range of [0, 1] describing how grounded is a specific + # claim by the references. + # Higher value means that the claim is better supported by the reference + # chunks. + # @!attribute [rw] grounding_check_required + # @return [::Boolean] + # Indicates that this claim required grounding check. When the + # system decided this claim didn't require attribution/grounding check, + # this field is set to false. In that case, no grounding check was + # done for the claim and therefore `grounding_score`, `sources` is not + # returned. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::CitationSource>] + # Optional. Citation sources for the claim. + class GroundingSupport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Reference. + # @!attribute [rw] unstructured_document_info + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::UnstructuredDocumentInfo] + # Unstructured document information. + # + # Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`, `structured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] chunk_info + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::ChunkInfo] + # Chunk information. + # + # Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`, `structured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] structured_document_info + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::StructuredDocumentInfo] + # Structured document information. + # + # Note: The following fields are mutually exclusive: `structured_document_info`, `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Reference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Unstructured document information. + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] uri + # @return [::String] + # URI for the document. + # @!attribute [rw] title + # @return [::String] + # Title. + # @!attribute [rw] chunk_contents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::UnstructuredDocumentInfo::ChunkContent>] + # List of cited chunk contents derived from document content. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # The structured JSON metadata for the document. + # It is populated from the struct data from the Chunk in search result. + class UnstructuredDocumentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Chunk content. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] relevance_score + # @return [::Float] + # The relevance of the chunk for a given query. Values range from 0.0 + # (completely irrelevant) to 1.0 (completely relevant). + # This value is for informational purpose only. It may change for + # the same query and chunk at any time due to a model retraining or + # change in implementation. + class ChunkContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Chunk information. + # @!attribute [rw] chunk + # @return [::String] + # Chunk resource name. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. + # @!attribute [rw] relevance_score + # @return [::Float] + # The relevance of the chunk for a given query. Values range from 0.0 + # (completely irrelevant) to 1.0 (completely relevant). + # This value is for informational purpose only. It may change for + # the same query and chunk at any time due to a model retraining or + # change in implementation. + # @!attribute [rw] document_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::ChunkInfo::DocumentMetadata] + # Document metadata. + class ChunkInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document metadata. + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] uri + # @return [::String] + # URI for the document. + # @!attribute [rw] title + # @return [::String] + # Title. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # The structured JSON metadata for the document. + # It is populated from the struct data from the Chunk in search result. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Structured search information. + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # Structured search data. + # @!attribute [r] title + # @return [::String] + # Output only. The title of the document. + # @!attribute [r] uri + # @return [::String] + # Output only. The URI of the document. + class StructuredDocumentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Step information. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::State] + # The state of the step. + # @!attribute [rw] description + # @return [::String] + # The description of the step. + # @!attribute [rw] thought + # @return [::String] + # The thought of the step. + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action>] + # Actions. + class Step + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Action. + # @!attribute [rw] search_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::SearchAction] + # Search action. + # @!attribute [rw] observation + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation] + # Observation. + class Action + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search action. + # @!attribute [rw] query + # @return [::String] + # The query to search. + class SearchAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Observation. + # @!attribute [rw] search_results + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult>] + # Search results observed by the search action, it can be snippets info + # or chunk info, depending on the citation type set by the user. + class Observation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] uri + # @return [::String] + # URI for the document. + # @!attribute [rw] title + # @return [::String] + # Title. + # @!attribute [rw] snippet_info + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult::SnippetInfo>] + # If citation_type is DOCUMENT_LEVEL_CITATION, populate document + # level snippets. + # @!attribute [rw] chunk_info + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult::ChunkInfo>] + # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, + # populate chunk info. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # Data representation. + # The structured JSON data for the document. + # It's populated from the struct data from the Document, or the + # Chunk in search result. + class SearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Snippet information. + # @!attribute [rw] snippet + # @return [::String] + # Snippet content. + # @!attribute [rw] snippet_status + # @return [::String] + # Status of the snippet defined by the search team. + class SnippetInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Chunk information. + # @!attribute [rw] chunk + # @return [::String] + # Chunk resource name. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. + # @!attribute [rw] relevance_score + # @return [::Float] + # The relevance of the chunk for a given query. Values range from + # 0.0 (completely irrelevant) to 1.0 (completely relevant). + # This value is for informational purpose only. It may change for + # the same query and chunk at any time due to a model retraining or + # change in implementation. + class ChunkInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + + # Enumeration of the state of the step. + module State + # Unknown. + STATE_UNSPECIFIED = 0 + + # Step is currently in progress. + IN_PROGRESS = 1 + + # Step currently failed. + FAILED = 2 + + # Step has succeeded. + SUCCEEDED = 3 + end + end + + # Query understanding information. + # @!attribute [rw] query_classification_info + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo::QueryClassificationInfo>] + # Query classification information. + class QueryUnderstandingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query classification information. + # @!attribute [rw] type + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo::QueryClassificationInfo::Type] + # Query classification type. + # @!attribute [rw] positive + # @return [::Boolean] + # Classification output. + class QueryClassificationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query classification types. + module Type + # Unspecified query classification type. + TYPE_UNSPECIFIED = 0 + + # Adversarial query classification type. + ADVERSARIAL_QUERY = 1 + + # Non-answer-seeking query classification type, for chit chat. + NON_ANSWER_SEEKING_QUERY = 2 + + # Jail-breaking query classification type. + JAIL_BREAKING_QUERY = 3 + + # Non-answer-seeking query classification type, for no clear intent. + NON_ANSWER_SEEKING_QUERY_V2 = 4 + + # User defined query classification type. + USER_DEFINED_CLASSIFICATION_QUERY = 5 + end + end + end + + # Enumeration of the state of the answer generation. + module State + # Unknown. + STATE_UNSPECIFIED = 0 + + # Answer generation is currently in progress. + IN_PROGRESS = 1 + + # Answer generation currently failed. + FAILED = 2 + + # Answer generation has succeeded. + SUCCEEDED = 3 + + # Answer generation is currently in progress. + STREAMING = 4 + end + + # An enum for answer skipped reasons. + module AnswerSkippedReason + # Default value. The answer skipped reason is not specified. + ANSWER_SKIPPED_REASON_UNSPECIFIED = 0 + + # The adversarial query ignored case. + ADVERSARIAL_QUERY_IGNORED = 1 + + # The non-answer seeking query ignored case + # + # Google skips the answer if the query is chit chat. + NON_ANSWER_SEEKING_QUERY_IGNORED = 2 + + # The out-of-domain query ignored case. + # + # Google skips the answer if there are no high-relevance search results. + OUT_OF_DOMAIN_QUERY_IGNORED = 3 + + # The potential policy violation case. + # + # Google skips the answer if there is a potential policy violation + # detected. This includes content that may be violent or toxic. + POTENTIAL_POLICY_VIOLATION = 4 + + # The no relevant content case. + # + # Google skips the answer if there is no relevant content in the + # retrieved search results. + NO_RELEVANT_CONTENT = 5 + + # The jail-breaking query ignored case. + # + # For example, "Reply in the tone of a competing company's CEO". + # Google skips the answer if the query is classified as a jail-breaking + # query. + JAIL_BREAKING_QUERY_IGNORED = 6 + + # The customer policy violation case. + # + # Google skips the summary if there is a customer policy violation + # detected. The policy is defined by the customer. + CUSTOMER_POLICY_VIOLATION = 7 + + # The non-answer seeking query ignored case. + # + # Google skips the answer if the query doesn't have clear intent. + NON_ANSWER_SEEKING_QUERY_IGNORED_V2 = 8 + + # The low-grounded answer case. + # + # Google skips the answer if a well grounded answer was unable to be + # generated. + LOW_GROUNDED_ANSWER = 9 + + # The user defined query classification ignored case. + # + # Google skips the answer if the query is classified as a user defined + # query classification. + USER_DEFINED_CLASSIFICATION_QUERY_IGNORED = 10 + + # The unhelpful answer case. + # + # Google skips the answer if the answer is not helpful. This can be due to + # a variety of factors, including but not limited to: the query is not + # answerable, the answer is not relevant to the query, or the answer is + # not well-formatted. + UNHELPFUL_ANSWER = 11 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb new file mode 100644 index 000000000000..d6f8953ca64c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # AssistAnswer resource, main part of + # [AssistResponse][google.cloud.discoveryengine.v1.AssistResponse]. + # @!attribute [rw] name + # @return [::String] + # Immutable. Resource name of the `AssistAnswer`. + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` + # + # This field must be a UTF-8 encoded string with a length limit of 1024 + # characters. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::State] + # State of the answer generation. + # @!attribute [rw] replies + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::Reply>] + # Replies of the assistant. + # @!attribute [rw] assist_skipped_reasons + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::AssistSkippedReason>] + # Reasons for not answering the assist call. + class AssistAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # One part of the multi-part response of the assist call. + # @!attribute [rw] grounded_content + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent] + # Possibly grounded response text or media from the assistant. + class Reply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # State of the answer generation. + module State + # Unknown. + STATE_UNSPECIFIED = 0 + + # Assist operation is currently in progress. + IN_PROGRESS = 1 + + # Assist operation has failed. + FAILED = 2 + + # Assist operation has succeeded. + SUCCEEDED = 3 + + # Assist operation has been skipped. + SKIPPED = 4 + end + + # Possible reasons for not answering an assist call. + module AssistSkippedReason + # Default value. Skip reason is not specified. + ASSIST_SKIPPED_REASON_UNSPECIFIED = 0 + + # The assistant ignored the query, because it did not appear to be + # answer-seeking. + NON_ASSIST_SEEKING_QUERY_IGNORED = 1 + + # The assistant ignored the query or refused to answer because of a + # customer policy violation (e.g., the query or the answer contained a + # banned phrase). + CUSTOMER_POLICY_VIOLATION = 2 + end + end + + # Multi-modal content. + # @!attribute [rw] text + # @return [::String] + # Inline text. + # + # Note: The following fields are mutually exclusive: `text`, `inline_data`, `file`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_data + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::Blob] + # Inline binary data. + # + # Note: The following fields are mutually exclusive: `inline_data`, `text`, `file`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] file + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::File] + # A file, e.g., an audio summary. + # + # Note: The following fields are mutually exclusive: `file`, `text`, `inline_data`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] executable_code + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::ExecutableCode] + # Code generated by the model that is meant to be executed. + # + # Note: The following fields are mutually exclusive: `executable_code`, `text`, `inline_data`, `file`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] code_execution_result + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::CodeExecutionResult] + # Result of executing an ExecutableCode. + # + # Note: The following fields are mutually exclusive: `code_execution_result`, `text`, `inline_data`, `file`, `executable_code`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] role + # @return [::String] + # The producer of the content. Can be "model" or "user". + # @!attribute [rw] thought + # @return [::Boolean] + # Optional. Indicates if the part is thought from the model. + class AssistantContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Inline blob. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The media type (MIME type) of the generated data. + # @!attribute [rw] data + # @return [::String] + # Required. Raw bytes. + class Blob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A file, e.g., an audio summary. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The media type (MIME type) of the file. + # @!attribute [rw] file_id + # @return [::String] + # Required. The file ID. + class File + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Code generated by the model that is meant to be executed by the model. + # @!attribute [rw] code + # @return [::String] + # Required. The code content. Currently only supports Python. + class ExecutableCode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Result of executing ExecutableCode. + # @!attribute [rw] outcome + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::CodeExecutionResult::Outcome] + # Required. Outcome of the code execution. + # @!attribute [rw] output + # @return [::String] + # Optional. Contains stdout when code execution is successful, stderr or + # other description otherwise. + class CodeExecutionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of possible outcomes of the code execution. + module Outcome + # Unspecified status. This value should not be used. + OUTCOME_UNSPECIFIED = 0 + + # Code execution completed successfully. + OUTCOME_OK = 1 + + # Code execution finished but with a failure. `stderr` should contain the + # reason. + OUTCOME_FAILED = 2 + + # Code execution ran for too long, and was cancelled. There may or may + # not be a partial output present. + OUTCOME_DEADLINE_EXCEEDED = 3 + end + end + end + + # A piece of content and possibly its grounding information. + # + # Not all content needs grounding. Phrases like "Of course, I will gladly + # search it for you." do not need grounding. + # @!attribute [rw] text_grounding_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata] + # Metadata for grounding based on text sources. + # @!attribute [rw] content + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent] + # The content. + class AssistantGroundedContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Grounding details for text sources. + # @!attribute [rw] segments + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Segment>] + # Grounding information for parts of the text. + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Reference>] + # References for the grounded text. + class TextGroundingMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Grounding information for a segment of the text. + # @!attribute [rw] start_index + # @return [::Integer] + # Zero-based index indicating the start of the segment, measured in bytes + # of a UTF-8 string (i.e. characters encoded on multiple bytes have a + # length of more than one). + # @!attribute [rw] end_index + # @return [::Integer] + # End of the segment, exclusive. + # @!attribute [rw] reference_indices + # @return [::Array<::Integer>] + # References for the segment. + # @!attribute [rw] grounding_score + # @return [::Float] + # Score for the segment. + # @!attribute [rw] text + # @return [::String] + # The text segment itself. + class Segment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Referenced content and related document metadata. + # @!attribute [rw] content + # @return [::String] + # Referenced text content. + # @!attribute [rw] document_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata] + # Document metadata. + class Reference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document metadata. + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] uri + # @return [::String] + # URI for the document. It may contain a URL that redirects to the + # actual website. + # @!attribute [rw] title + # @return [::String] + # Title. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] domain + # @return [::String] + # Domain name from the document URI. Note that the `uri` field may + # contain a URL that redirects to the actual website, in which case + # this will contain the domain name of the target site. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb new file mode 100644 index 000000000000..b25f47b4c46a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Discovery Engine Assistant resource. + # @!attribute [rw] name + # @return [::String] + # Immutable. Resource name of the assistant. + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` + # + # It must be a UTF-8 encoded string with a length limit of 1024 characters. + class Assistant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb new file mode 100644 index 000000000000..53b98459c097 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb @@ -0,0 +1,207 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # User metadata of the request. + # @!attribute [rw] time_zone + # @return [::String] + # Optional. IANA time zone, e.g. Europe/Budapest. + # @!attribute [rw] preferred_language_code + # @return [::String] + # Optional. Preferred language to be used for answering if language detection + # fails. Also used as the language of error messages created by actions, + # regardless of language detection results. + class AssistUserMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist AssistantService.StreamAssist} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` + # @!attribute [rw] query + # @return [::Google::Cloud::DiscoveryEngine::V1::Query] + # Optional. Current user query. + # + # Empty query is only supported if `file_ids` are provided. In this case, the + # answer will be generated based on those context files. + # @!attribute [rw] session + # @return [::String] + # Optional. The session to use for the request. If specified, the assistant + # has access to the session history, and the query and the answer are stored + # there. + # + # If `-` is specified as the session ID, or it is left empty, then a new + # session is created with an automatically generated ID. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` + # @!attribute [rw] user_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata] + # Optional. Information about the user initiating the query. + # @!attribute [rw] tools_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec] + # Optional. Specification of tools that are used to serve the request. + # @!attribute [rw] generation_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec] + # Optional. Specification of the generation configuration for the request. + class StreamAssistRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification of tools that are used to serve the request. + # @!attribute [rw] vertex_ai_search_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::VertexAiSearchSpec] + # Optional. Specification of the Vertex AI Search tool. + # @!attribute [rw] web_grounding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::WebGroundingSpec] + # Optional. Specification of the web grounding tool. + # If field is present, enables grounding with web search. Works only if + # [Assistant.web_grounding_type][google.cloud.discoveryengine.v1.Assistant.web_grounding_type] + # is [WEB_GROUNDING_TYPE_GOOGLE_SEARCH][] or + # [WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH][]. + # @!attribute [rw] image_generation_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::ImageGenerationSpec] + # Optional. Specification of the image generation tool. + # @!attribute [rw] video_generation_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::VideoGenerationSpec] + # Optional. Specification of the video generation tool. + class ToolsSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification of the Vertex AI Search tool. + # @!attribute [rw] data_store_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] + # Optional. Specs defining + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to filter on in + # a search call and configurations for those data stores. This is only + # considered for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with + # multiple data stores. + # @!attribute [rw] filter + # @return [::String] + # Optional. 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to + # a key property defined in the Vertex AI Search backend -- this mapping + # is defined by the customer in their schema. For example a media + # customer might have a field 'name' in their schema. In this case the + # filter would look like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + class VertexAiSearchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of the web grounding tool. + class WebGroundingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of the image generation tool. + class ImageGenerationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of the video generation tool. + class VideoGenerationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Assistant generation specification for the request. + # This allows to override the default generation configuration at the engine + # level. + # @!attribute [rw] model_id + # @return [::String] + # Optional. The Vertex AI model_id used for the generative model. If not + # set, the default Assistant model will be used. + class GenerationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response for the + # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist AssistantService.StreamAssist} + # method. + # @!attribute [rw] answer + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer] + # Assist answer resource object containing parts of the assistant's final + # answer for the user's query. + # + # Not present if the current response doesn't add anything to previously + # sent + # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#replies AssistAnswer.replies}. + # + # Observe + # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#state AssistAnswer.state} to + # see if more parts are to be expected. While the state is `IN_PROGRESS`, the + # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#replies AssistAnswer.replies} + # field in each response will contain replies (reply fragments) to be + # appended to the ones received in previous responses. [AssistAnswer.name][] + # won't be filled. + # + # If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response + # is the last response and [AssistAnswer.name][] will have a value. + # @!attribute [rw] session_info + # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse::SessionInfo] + # Session information. + # @!attribute [rw] assist_token + # @return [::String] + # A global unique ID that identifies the current pair of request and stream + # of responses. Used for feedback and support. + class StreamAssistResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about the session. + # @!attribute [rw] session + # @return [::String] + # Name of the newly generated or continued session. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`. + class SessionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb new file mode 100644 index 000000000000..cdccc43c7688 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Chunk captures all raw metadata information of items to be recommended or + # searched in the chunk mode. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the chunk. + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. + # + # This field must be a UTF-8 encoded string with a length limit of 1024 + # characters. + # @!attribute [rw] id + # @return [::String] + # Unique chunk ID of the current chunk. + # @!attribute [rw] content + # @return [::String] + # Content is a string from a document (parsed content). + # @!attribute [r] relevance_score + # @return [::Float] + # Output only. Represents the relevance score based on similarity. + # Higher score indicates higher chunk relevance. + # The score is in range [-1.0, 1.0]. + # Only populated on + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse SearchResponse}. + # @!attribute [rw] document_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::DocumentMetadata] + # Metadata of the document from the current chunk. + # @!attribute [r] derived_struct_data + # @return [::Google::Protobuf::Struct] + # Output only. This field is OUTPUT_ONLY. + # It contains derived data that are not in the original input document. + # @!attribute [rw] page_span + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::PageSpan] + # Page span of the chunk. + # @!attribute [r] chunk_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::ChunkMetadata] + # Output only. Metadata of the current chunk. + # @!attribute [r] data_urls + # @return [::Array<::String>] + # Output only. Image Data URLs if the current chunk contains images. + # Data URLs are composed of four parts: a prefix (data:), a MIME type + # indicating the type of data, an optional base64 token if non-textual, + # and the data itself: + # data:[][;base64], + # @!attribute [r] annotation_contents + # @return [::Array<::String>] + # Output only. Annotation contents if the current chunk contains annotations. + # @!attribute [r] annotation_metadata + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk::AnnotationMetadata>] + # Output only. The annotation metadata includes structured content in the + # current chunk. + class Chunk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document metadata contains the information of the document of the current + # chunk. + # @!attribute [rw] uri + # @return [::String] + # Uri of the document. + # @!attribute [rw] title + # @return [::String] + # Title of the document. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # Data representation. + # The structured JSON data for the document. It should conform to the + # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an + # `INVALID_ARGUMENT` error is thrown. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Page span of the chunk. + # @!attribute [rw] page_start + # @return [::Integer] + # The start page of the chunk. + # @!attribute [rw] page_end + # @return [::Integer] + # The end page of the chunk. + class PageSpan + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the current chunk. This field is only populated on + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # API. + # @!attribute [rw] previous_chunks + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk>] + # The previous chunks of the current chunk. The number is controlled by + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec#num_previous_chunks SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks}. + # This field is only populated on + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # API. + # @!attribute [rw] next_chunks + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk>] + # The next chunks of the current chunk. The number is controlled by + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec#num_next_chunks SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks}. + # This field is only populated on + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # API. + class ChunkMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The structured content information. + # @!attribute [r] structure_type + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::StructureType] + # Output only. The structure type of the structured content. + # @!attribute [r] content + # @return [::String] + # Output only. The content of the structured content. + class StructuredContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The annotation metadata includes structured content in the current chunk. + # @!attribute [r] structured_content + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::StructuredContent] + # Output only. The structured content information. + # @!attribute [r] image_id + # @return [::String] + # Output only. Image id is provided if the structured content is based on + # an image. + class AnnotationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the types of the structured content that can be extracted. + module StructureType + # Default value. + STRUCTURE_TYPE_UNSPECIFIED = 0 + + # Shareholder structure. + SHAREHOLDER_STRUCTURE = 1 + + # Signature structure. + SIGNATURE_STRUCTURE = 2 + + # Checkbox structure. + CHECKBOX_STRUCTURE = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb new file mode 100644 index 000000000000..c54fc7670ebd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for UpdateCmekConfig method. + # rpc. + # @!attribute [rw] config + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # Required. The CmekConfig resource. + # @!attribute [rw] set_default + # @return [::Boolean] + # Set the following CmekConfig as the default to be used for child + # resources if one is not specified. + class UpdateCmekConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetCmekConfigRequest method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as + # `projects/*/locations/*/cmekConfig` or + # `projects/*/locations/*/cmekConfigs/*`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + class GetCmekConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for single-regional CMEKs. + # @!attribute [rw] kms_key + # @return [::String] + # Required. Single-regional kms key resource name which will be used to + # encrypt resources + # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. + class SingleRegionKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configurations used to enable CMEK data encryption with Cloud KMS keys. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CmekConfig of the form + # `projects/{project}/locations/{location}/cmekConfig` or + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. + # @!attribute [rw] kms_key + # @return [::String] + # KMS key resource name which will be used to encrypt resources + # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. + # @!attribute [rw] kms_key_version + # @return [::String] + # KMS key version resource name which will be used to encrypt resources + # `/cryptoKeyVersions/{keyVersion}`. + # @!attribute [r] state + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig::State] + # Output only. The states of the CmekConfig. + # @!attribute [r] is_default + # @return [::Boolean] + # Output only. The default CmekConfig for the Customer. + # @!attribute [r] last_rotation_timestamp_micros + # @return [::Integer] + # Output only. The timestamp of the last key rotation. + # @!attribute [rw] single_region_keys + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SingleRegionKey>] + # Optional. Single-regional CMEKs that are required for some VAIS features. + # @!attribute [r] notebooklm_state + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig::NotebookLMState] + # Output only. Whether the NotebookLM Corpus is ready to be used. + class CmekConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # States of the CmekConfig. + module State + # The CmekConfig state is unknown. + STATE_UNSPECIFIED = 0 + + # The CmekConfig is creating. + CREATING = 1 + + # The CmekConfig can be used with DataStores. + ACTIVE = 2 + + # The CmekConfig is unavailable, most likely due to the KMS Key being + # revoked. + KEY_ISSUE = 3 + + # The CmekConfig is deleting. + DELETING = 4 + + # The CmekConfig deletion process failed. + DELETE_FAILED = 7 + + # The CmekConfig is not usable, most likely due to some internal issue. + UNUSABLE = 5 + + # The KMS key version is being rotated. + ACTIVE_ROTATING = 6 + + # The KMS key is soft deleted. Some cleanup policy will eventually be + # applied. + DELETED = 8 + end + + # States of NotebookLM. + module NotebookLMState + # The NotebookLM state is unknown. + NOTEBOOK_LM_STATE_UNSPECIFIED = 0 + + # The NotebookLM is not ready. + NOTEBOOK_LM_NOT_READY = 1 + + # The NotebookLM is ready to be used. + NOTEBOOK_LM_READY = 2 + + # The NotebookLM is not enabled. + NOTEBOOK_LM_NOT_ENABLED = 3 + end + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config CmekConfigService.UpdateCmekConfig} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class UpdateCmekConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs CmekConfigService.ListCmekConfigs} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location resource name, such as + # `projects/{project}/locations/{location}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this + # location, regardless of whether or not a CmekConfig exists, a + # PERMISSION_DENIED error is returned. + class ListCmekConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs CmekConfigService.ListCmekConfigs} + # method. + # @!attribute [rw] cmek_configs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CmekConfig>] + # All the customer's + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s. + class ListCmekConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config CmekConfigService.DeleteCmekConfig} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as + # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. + class DeleteCmekConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config CmekConfigService.DeleteCmekConfig} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteCmekConfigMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb new file mode 100644 index 000000000000..24f6a2d4d871 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb @@ -0,0 +1,284 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # A floating point interval. + # @!attribute [rw] minimum + # @return [::Float] + # Inclusive lower bound. + # + # Note: The following fields are mutually exclusive: `minimum`, `exclusive_minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclusive_minimum + # @return [::Float] + # Exclusive lower bound. + # + # Note: The following fields are mutually exclusive: `exclusive_minimum`, `minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] maximum + # @return [::Float] + # Inclusive upper bound. + # + # Note: The following fields are mutually exclusive: `maximum`, `exclusive_maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] exclusive_maximum + # @return [::Float] + # Exclusive upper bound. + # + # Note: The following fields are mutually exclusive: `exclusive_maximum`, `maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Interval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A custom attribute that is not explicitly modeled in a resource, e.g. + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent}. + # @!attribute [rw] text + # @return [::Array<::String>] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#text CustomAttribute.text} + # or + # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#numbers CustomAttribute.numbers} + # should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @!attribute [rw] numbers + # @return [::Array<::Float>] + # The numerical values of this custom attribute. For example, `[2.3, 15.4]` + # when the key is "lengths_cm". + # + # Exactly one of + # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#text CustomAttribute.text} + # or + # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#numbers CustomAttribute.numbers} + # should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. + class CustomAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information of an end user. + # @!attribute [rw] user_id + # @return [::String] + # 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. + # @!attribute [rw] user_agent + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} + # or if + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#direct_user_request UserEvent.direct_user_request} + # is set. + # @!attribute [rw] time_zone + # @return [::String] + # Optional. IANA time zone, e.g. Europe/Budapest. + class UserInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Double list. + # @!attribute [rw] values + # @return [::Array<::Float>] + # Double values. + class DoubleList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Principal identifier of a user or a group. + # @!attribute [rw] user_id + # @return [::String] + # User identifier. + # For Google Workspace user account, user_id should be the google workspace + # user email. + # For non-google identity provider user account, user_id is the mapped user + # identifier configured during the workforcepool config. + # + # Note: The following fields are mutually exclusive: `user_id`, `group_id`, `external_entity_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] group_id + # @return [::String] + # Group identifier. + # For Google Workspace user account, group_id should be the google + # workspace group email. + # For non-google identity provider user account, group_id is the mapped + # group identifier configured during the workforcepool config. + # + # Note: The following fields are mutually exclusive: `group_id`, `user_id`, `external_entity_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] external_entity_id + # @return [::String] + # For 3P application identities which are not present in the customer + # identity provider. + # + # Note: The following fields are mutually exclusive: `external_entity_id`, `user_id`, `group_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Principal + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config to data store for `HEALTHCARE_FHIR` vertical. + # @!attribute [rw] enable_configurable_schema + # @return [::Boolean] + # Whether to enable configurable schema for `HEALTHCARE_FHIR` vertical. + # + # If set to `true`, the predefined healthcare fhir schema can be extended + # for more customized searching and filtering. + # @!attribute [rw] enable_static_indexing_for_batch_ingestion + # @return [::Boolean] + # Whether to enable static indexing for `HEALTHCARE_FHIR` batch + # ingestion. + # + # If set to `true`, the batch ingestion will be processed in a static + # indexing mode which is slower but more capable of handling larger + # volume. + class HealthcareFhirConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Promotion proto includes uri and other helping information to display the + # promotion. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the promotion. + # Maximum length: 160 characters. + # @!attribute [rw] uri + # @return [::String] + # Optional. The URL for the page the user wants to promote. Must be set for + # site search. For other verticals, this is optional. + # @!attribute [rw] document + # @return [::String] + # Optional. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} the user + # wants to promote. For site search, leave unset and only populate uri. Can + # be set along with uri. + # @!attribute [rw] image_uri + # @return [::String] + # Optional. The promotion thumbnail image url. + # @!attribute [rw] description + # @return [::String] + # Optional. The Promotion description. + # Maximum length: 200 characters. + # @!attribute [rw] enabled + # @return [::Boolean] + # Optional. The enabled promotion will be returned for any serving configs + # associated with the parent of the control this promotion is attached to. + # + # This flag is used for basic site search only. + class SearchLinkPromotion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The industry vertical associated with the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + module IndustryVertical + # Value used when unset. + INDUSTRY_VERTICAL_UNSPECIFIED = 0 + + # The generic vertical for documents that are not specific to any industry + # vertical. + GENERIC = 1 + + # The media industry vertical. + MEDIA = 2 + + # The healthcare FHIR vertical. + HEALTHCARE_FHIR = 7 + end + + # The type of solution. + module 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 + + # Used for use cases related to the Generative Chat agent. + # It's used for Generative chat engine only, the associated data stores + # must enrolled with `SOLUTION_TYPE_CHAT` solution. + SOLUTION_TYPE_GENERATIVE_CHAT = 4 + end + + # Defines a further subdivision of `SolutionType`. + # Specifically applies to + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + module SearchUseCase + # Value used when unset. Will not occur in CSS. + SEARCH_USE_CASE_UNSPECIFIED = 0 + + # Search use case. Expects the traffic has a non-empty + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query query}. + SEARCH_USE_CASE_SEARCH = 1 + + # Browse use case. Expects the traffic has an empty + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query query}. + SEARCH_USE_CASE_BROWSE = 2 + end + + # Tiers of search features. Different tiers might have different + # pricing. To learn more, check the pricing documentation. + module SearchTier + # Default value when the enum is unspecified. This is invalid to use. + SEARCH_TIER_UNSPECIFIED = 0 + + # Standard tier. + SEARCH_TIER_STANDARD = 1 + + # Enterprise tier. + SEARCH_TIER_ENTERPRISE = 2 + end + + # Add-on that provides additional functionality for search. + module SearchAddOn + # Default value when the enum is unspecified. This is invalid to use. + SEARCH_ADD_ON_UNSPECIFIED = 0 + + # Large language model add-on. + SEARCH_ADD_ON_LLM = 1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb new file mode 100644 index 000000000000..debb90a986d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Suggestion deny list entry identifying the phrase to block from suggestions + # and the applied operation for the phrase. + # @!attribute [rw] block_phrase + # @return [::String] + # Required. Phrase to block from suggestions served. Can be maximum 125 + # characters. + # @!attribute [rw] match_operator + # @return [::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry::MatchOperator] + # Required. The match operator to apply for this phrase. Whether to block the + # exact phrase, or block any suggestions containing this phrase. + class SuggestionDenyListEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Operator for matching with the generated suggestions. + module MatchOperator + # Default value. Should not be used + MATCH_OPERATOR_UNSPECIFIED = 0 + + # If the suggestion is an exact match to the block_phrase, then block it. + EXACT_MATCH = 1 + + # If the suggestion contains the block_phrase, then block it. + CONTAINS = 2 + end + end + + # Autocomplete suggestions that are imported from Customer. + # @!attribute [rw] global_score + # @return [::Float] + # Global score of this suggestion. Control how this suggestion would be + # scored / ranked. + # + # Note: The following fields are mutually exclusive: `global_score`, `frequency`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] frequency + # @return [::Integer] + # Frequency of this suggestion. Will be used to rank suggestions when score + # is not available. + # + # Note: The following fields are mutually exclusive: `frequency`, `global_score`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggestion + # @return [::String] + # Required. The suggestion text. + # @!attribute [rw] language_code + # @return [::String] + # BCP-47 language code of this suggestion. + # @!attribute [rw] group_id + # @return [::String] + # If two suggestions have the same groupId, they will not be + # returned together. Instead the one ranked higher will be returned. This can + # be used to deduplicate semantically identical suggestions. + # @!attribute [rw] group_score + # @return [::Float] + # The score of this suggestion within its group. + # @!attribute [rw] alternative_phrases + # @return [::Array<::String>] + # Alternative matching phrases for this suggestion. + class CompletionSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb new file mode 100644 index 000000000000..6dc5b172bd5d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query CompletionService.CompleteQuery} + # method. + # @!attribute [rw] data_store + # @return [::String] + # 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`. + # @!attribute [rw] query + # @return [::String] + # Required. The typeahead input used to fetch suggestions. Maximum length is + # 128 characters. + # @!attribute [rw] query_model + # @return [::String] + # Specifies the autocomplete data model. This overrides any model specified + # in the Configuration > Autocomplete section of the Cloud console. Currently + # supported values: + # + # * `document` - Using suggestions generated from user-imported documents. + # * `search-history` - Using suggestions generated from the past history of + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. + # @!attribute [rw] include_tail_suggestions + # @return [::Boolean] + # 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. + class CompleteQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query CompletionService.CompleteQuery} + # method. + # @!attribute [rw] query_suggestions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion>] + # Results of the matched query suggestions. The result list is ordered and + # the first result is a top suggestion. + # @!attribute [rw] tail_match_triggered + # @return [::Boolean] + # 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. + class CompleteQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Suggestions as search queries. + # @!attribute [rw] suggestion + # @return [::String] + # The suggestion for the query. + # @!attribute [rw] completable_field_paths + # @return [::Array<::String>] + # 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. + class QuerySuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb new file mode 100644 index 000000000000..0e7da491c6ae --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb @@ -0,0 +1,339 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Defines circumstances to be checked before allowing a behavior + # @!attribute [rw] query_terms + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition::QueryTerm>] + # Search only + # A list of terms to match the query on. + # Cannot be set when + # {::Google::Cloud::DiscoveryEngine::V1::Condition#query_regex Condition.query_regex} + # is set. + # + # Maximum of 10 query terms. + # @!attribute [rw] active_time_range + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition::TimeRange>] + # Range of time(s) specifying when condition is active. + # + # Maximum of 10 time ranges. + # @!attribute [rw] query_regex + # @return [::String] + # Optional. Query regex to match the whole search query. + # Cannot be set when + # {::Google::Cloud::DiscoveryEngine::V1::Condition#query_terms Condition.query_terms} + # is set. Only supported for Basic Site Search promotion serving controls. + class Condition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Matcher for search request query + # @!attribute [rw] value + # @return [::String] + # The specific query value to match against + # + # Must be lowercase, must be UTF-8. + # Can have at most 3 space separated terms if full_match is true. + # Cannot be an empty string. + # Maximum length of 5000 characters. + # @!attribute [rw] full_match + # @return [::Boolean] + # Whether the search query needs to exactly match the query term. + class QueryTerm + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used for time-dependent conditions. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start of time range. + # + # Range is inclusive. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of time range. + # + # Range is inclusive. + # Must be in the future. + class TimeRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines a conditioned behavior to employ during serving. + # Must be attached to a + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to be + # considered at serving time. Permitted actions dependent on `SolutionType`. + # @!attribute [rw] boost_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction] + # Defines a boost-type control + # + # Note: The following fields are mutually exclusive: `boost_action`, `filter_action`, `redirect_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] filter_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::FilterAction] + # Defines a filter-type control + # Currently not supported by Recommendation + # + # Note: The following fields are mutually exclusive: `filter_action`, `boost_action`, `redirect_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] redirect_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::RedirectAction] + # Defines a redirect-type control. + # + # Note: The following fields are mutually exclusive: `redirect_action`, `boost_action`, `filter_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] synonyms_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::SynonymsAction] + # Treats a group of terms as synonyms of one another. + # + # Note: The following fields are mutually exclusive: `synonyms_action`, `boost_action`, `filter_action`, `redirect_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] promote_action + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::PromoteAction] + # Promote certain links based on predefined trigger queries. + # + # Note: The following fields are mutually exclusive: `promote_action`, `boost_action`, `filter_action`, `redirect_action`, `synonyms_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/*/locations/global/dataStore/*/controls/*` + # @!attribute [rw] display_name + # @return [::String] + # Required. Human readable name. The identifier used in UI views. + # + # Must be UTF-8 encoded string. Length limit is 128 characters. + # Otherwise an INVALID ARGUMENT error is thrown. + # @!attribute [r] associated_serving_config_ids + # @return [::Array<::String>] + # Output only. List of all + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} IDs this + # control is attached to. May take up to 10 minutes to update after changes. + # @!attribute [rw] solution_type + # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] + # Required. Immutable. What solution the control belongs to. + # + # Must be compatible with vertical of resource. + # Otherwise an INVALID ARGUMENT error is thrown. + # @!attribute [rw] use_cases + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchUseCase>] + # Specifies the use case for the control. + # Affects what condition fields can be set. + # Only applies to + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # Currently only allow one use case per control. + # Must be set when solution_type is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SolutionType.SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] conditions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition>] + # Determines when the associated action will trigger. + # + # Omit to always apply the action. + # Currently only a single condition may be specified. + # Otherwise an INVALID ARGUMENT error is thrown. + class Control + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Adjusts order of products in returned list. + # @!attribute [rw] fixed_boost + # @return [::Float] + # Optional. Strength of the boost, which should be in [-1, 1]. Negative + # boost means demotion. Default is 0.0 (No-op). + # + # Note: The following fields are mutually exclusive: `fixed_boost`, `interpolation_boost_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] interpolation_boost_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec] + # Optional. Complex specification for custom ranking based on customer + # defined attribute value. + # + # Note: The following fields are mutually exclusive: `interpolation_boost_spec`, `fixed_boost`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] boost + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Float] + # Strength of the boost, which should be in [-1, 1]. Negative + # boost means demotion. Default is 0.0 (No-op). + # @!attribute [rw] filter + # @return [::String] + # Required. Specifies which products to apply the boost to. + # + # If no filter is provided all products will be boosted (No-op). + # Syntax documentation: + # https://cloud.google.com/retail/docs/filter-and-order + # Maximum length is 5000 characters. + # Otherwise an INVALID ARGUMENT error is thrown. + # @!attribute [rw] data_store + # @return [::String] + # Required. Specifies which data store's documents can be boosted by this + # control. Full data store name e.g. + # projects/123/locations/global/collections/default_collection/dataStores/default_data_store + class BoostAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification for custom ranking based on customer specified attribute + # value. It provides more controls for customized ranking than the simple + # (condition, boost) combination above. + # @!attribute [rw] field_name + # @return [::String] + # Optional. The name of the field whose value will be used to determine + # the boost amount. + # @!attribute [rw] attribute_type + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::AttributeType] + # Optional. The attribute type to be used to determine the boost amount. + # The attribute value can be derived from the field value of the + # specified field_name. In the case of numerical it is straightforward + # i.e. attribute_value = numerical_field_value. In the case of freshness + # however, attribute_value = (time.now() - datetime_field_value). + # @!attribute [rw] interpolation_type + # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::InterpolationType] + # Optional. The interpolation type to be applied to connect the control + # points listed below. + # @!attribute [rw] control_points + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::ControlPoint>] + # Optional. The control points used to define the curve. The monotonic + # function (defined through the interpolation_type above) passes through + # the control points listed here. + class InterpolationBoostSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The control points used to define the curve. The curve defined + # through these control points can only be monotonically increasing + # or decreasing(constant values are acceptable). + # @!attribute [rw] attribute_value + # @return [::String] + # Optional. Can be one of: + # 1. The numerical field value. + # 2. The duration spec for freshness: + # The value must be formatted as an XSD `dayTimeDuration` value (a + # restricted subset of an ISO 8601 duration value). The pattern for + # this is: `[nD][T[nH][nM][nS]]`. + # @!attribute [rw] boost_amount + # @return [::Float] + # Optional. The value between -1 to 1 by which to boost the score if + # the attribute_value evaluates to the value specified above. + class ControlPoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The attribute(or function) for which the custom ranking is to be + # applied. + module AttributeType + # Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0 + + # The value of the numerical field will be used to dynamically update + # the boost amount. In this case, the attribute_value (the x value) + # of the control point will be the actual value of the numerical + # field for which the boost_amount is specified. + NUMERICAL = 1 + + # For the freshness use case the attribute value will be the duration + # between the current time and the date in the datetime field + # specified. The value must be formatted as an XSD `dayTimeDuration` + # value (a restricted subset of an ISO 8601 duration value). The + # pattern for this is: `[nD][T[nH][nM][nS]]`. + # For example, `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2 + end + + # The interpolation type to be applied. Default will be linear + # (Piecewise Linear). + module InterpolationType + # Interpolation type is unspecified. In this case, it defaults to + # Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0 + + # Piecewise linear interpolation will be applied. + LINEAR = 1 + end + end + end + + # Specified which products may be included in results. + # Uses same filter as boost. + # @!attribute [rw] filter + # @return [::String] + # Required. A filter to apply on the matching condition results. + # + # Required + # Syntax documentation: + # https://cloud.google.com/retail/docs/filter-and-order + # Maximum length is 5000 characters. Otherwise an INVALID + # ARGUMENT error is thrown. + # @!attribute [rw] data_store + # @return [::String] + # Required. Specifies which data store's documents can be filtered by this + # control. Full data store name e.g. + # projects/123/locations/global/collections/default_collection/dataStores/default_data_store + class FilterAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Redirects a shopper to the provided URI. + # @!attribute [rw] redirect_uri + # @return [::String] + # Required. The URI to which the shopper will be redirected. + # + # Required. + # URI must have length equal or less than 2000 characters. + # Otherwise an INVALID ARGUMENT error is thrown. + class RedirectAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Creates a set of terms that will act as synonyms of one another. + # + # Example: "happy" will also be considered as "glad", "glad" will also be + # considered as "happy". + # @!attribute [rw] synonyms + # @return [::Array<::String>] + # Defines a set of synonyms. + # Can specify up to 100 synonyms. + # Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is + # thrown. + class SynonymsAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Promote certain links based on some trigger queries. + # + # Example: Promote shoe store link when searching for `shoe` keyword. + # The link can be outside of associated data store. + # @!attribute [rw] data_store + # @return [::String] + # Required. Data store with which this promotion is attached to. + # @!attribute [rw] search_link_promotion + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion] + # Required. Promotion attached to this action. + class PromoteAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb new file mode 100644 index 000000000000..bc3ab8d77328 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request for CreateControl method. + # @!attribute [rw] parent + # @return [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @!attribute [rw] control + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # Required. The Control to create. + # @!attribute [rw] control_id + # @return [::String] + # Required. The ID to use for the Control, which will become the final + # component of the Control's resource name. + # + # This value must be within 1-63 characters. + # Valid characters are /[a-z][0-9]-_/. + class CreateControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateControl method. + # @!attribute [rw] control + # @return [::Google::Cloud::DiscoveryEngine::V1::Control] + # Required. The Control to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} + # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} + # + # If not set or empty, all supported fields are updated. + class UpdateControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for DeleteControl method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Control to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + class DeleteControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetControl method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Control to get. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` + class GetControlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListControls method. + # @!attribute [rw] parent + # @return [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` + # or + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListControls` call. + # Provide this to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter to apply on the list results. Supported features: + # + # * List all the products under the parent branch if + # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is + # unset. Currently this field is unsupported. + class ListControlsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListControls method. + # @!attribute [rw] controls + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Control>] + # All the Controls for a given data store. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListControlsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb new file mode 100644 index 000000000000..e52d1b12debf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # External conversation proto definition. + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` + # or + # `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation::State] + # The state of the Conversation. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # A unique identifier for tracking users. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::ConversationMessage>] + # Conversation messages. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the conversation started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the conversation finished. + class Conversation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of the state of the conversation. + module State + # Unknown. + STATE_UNSPECIFIED = 0 + + # Conversation is currently open. + IN_PROGRESS = 1 + + # Conversation has been completed. + COMPLETED = 2 + end + end + + # Defines a reply message to user. + # @!attribute [rw] summary + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary] + # Summary based on search results. + class Reply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines context of the conversation + # @!attribute [rw] context_documents + # @return [::Array<::String>] + # The current list of documents the user is seeing. + # It contains the document resource references. + # @!attribute [rw] active_document + # @return [::String] + # The current active document the user opened. + # It contains the document resource reference. + class ConversationContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines text input. + # @!attribute [rw] input + # @return [::String] + # Text input. + # @!attribute [rw] context + # @return [::Google::Cloud::DiscoveryEngine::V1::ConversationContext] + # Conversation context of the input. + class TextInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines a conversation message. + # @!attribute [rw] user_input + # @return [::Google::Cloud::DiscoveryEngine::V1::TextInput] + # User text input. + # + # Note: The following fields are mutually exclusive: `user_input`, `reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reply + # @return [::Google::Cloud::DiscoveryEngine::V1::Reply] + # Search reply. + # + # Note: The following fields are mutually exclusive: `reply`, `user_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Message creation timestamp. + class ConversationMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb new file mode 100644 index 000000000000..2f8416fb5406 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb @@ -0,0 +1,982 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation ConversationalSearchService.ConverseConversation} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. + # Use + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` + # to activate auto session mode, which automatically creates a new + # conversation inside a ConverseConversation session. + # @!attribute [rw] query + # @return [::Google::Cloud::DiscoveryEngine::V1::TextInput] + # Required. Current user input. + # @!attribute [rw] serving_config + # @return [::String] + # The resource name of the Serving Config to use. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` + # If this is not set, the default serving config will be used. + # @!attribute [rw] conversation + # @return [::Google::Cloud::DiscoveryEngine::V1::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. + # @!attribute [rw] safe_search + # @return [::Boolean] + # Whether to turn on safe search. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + # @!attribute [rw] summary_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec] + # A specification for configuring the summary returned in the response. + # @!attribute [rw] filter + # @return [::String] + # 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. This will be used to filter search results + # which may affect the summary response. + # + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] + # Boost specification to boost certain documents in search results which may + # affect the converse response. For more information on boosting, see + # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + class ConverseConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation ConversationalSearchService.ConverseConversation} + # method. + # @!attribute [rw] reply + # @return [::Google::Cloud::DiscoveryEngine::V1::Reply] + # Answer to the current query. + # @!attribute [rw] conversation + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # Updated conversation including the answer. + # @!attribute [rw] search_results + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # Search Results. + class ConverseConversationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for CreateConversation method. + # @!attribute [rw] parent + # @return [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @!attribute [rw] conversation + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # Required. The conversation to create. + class CreateConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateConversation method. + # @!attribute [rw] conversation + # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] + # Required. The Conversation to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The + # following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} + # + # If not set or empty, all supported fields are updated. + class UpdateConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for DeleteConversation method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Conversation to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + class DeleteConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetConversation method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Conversation to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` + class GetConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListConversations method. + # @!attribute [rw] parent + # @return [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListConversations` call. + # Provide this to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # A filter to apply on the list results. The supported features are: + # user_pseudo_id, state. + # + # Example: + # "user_pseudo_id = some_id" + # @!attribute [rw] order_by + # @return [::String] + # 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" + class ListConversationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListConversations method. + # @!attribute [rw] conversations + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Conversation>] + # All the Conversations for a given data store. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListConversationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery} + # method. + # @!attribute [rw] serving_config + # @return [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. + # This field is used to identify the serving configuration name, set + # of models used to make the search. + # @!attribute [rw] query + # @return [::Google::Cloud::DiscoveryEngine::V1::Query] + # Required. Current user query. + # @!attribute [rw] session + # @return [::String] + # The session resource name. Not required. + # + # When session field is not set, the API is in sessionless mode. + # + # We support auto session mode: users can use the wildcard symbol `-` as + # session ID. A new ID will be automatically generated and assigned. + # @!attribute [rw] safety_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec] + # Model specification. + # @!attribute [rw] related_questions_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec] + # Related questions specification. + # @!attribute [rw] grounding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec] + # Optional. Grounding specification. + # @!attribute [rw] answer_generation_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec] + # Answer generation specification. + # @!attribute [rw] search_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec] + # Search specification. + # @!attribute [rw] query_understanding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec] + # Query understanding specification. + # @!attribute [rw] asynchronous_mode + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Deprecated: This field is deprecated. Streaming Answer API will be + # supported. + # + # Asynchronous mode control. + # + # If enabled, the response will be returned with answer/session resource + # name without final answer. The API users need to do the polling to get + # the latest status of answer/session by calling + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} + # or + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} + # method. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # 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`. + # + # The field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + # @!attribute [rw] end_user_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec] + # Optional. End user specification. + class AnswerQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Safety specification. + # There are two use cases: + # 1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold + # will be applied for all categories. + # 2. when safety_spec.enable is set and some safety_settings are set, only + # specified safety_settings are applied. + # @!attribute [rw] enable + # @return [::Boolean] + # Enable the safety filtering on the answer response. It is false by + # default. + # @!attribute [rw] safety_settings + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting>] + # Optional. Safety settings. + # This settings are effective only when the safety_spec.enable is true. + class SafetySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Safety settings. + # @!attribute [rw] category + # @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory] + # Required. Harm category. + # @!attribute [rw] threshold + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold] + # Required. The harm block threshold. + class SafetySetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Probability based thresholds levels for blocking. + module HarmBlockThreshold + # Unspecified harm block threshold. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0 + + # Block low threshold and above (i.e. block more). + BLOCK_LOW_AND_ABOVE = 1 + + # Block medium threshold and above. + BLOCK_MEDIUM_AND_ABOVE = 2 + + # Block only high threshold (i.e. block less). + BLOCK_ONLY_HIGH = 3 + + # Block none. + BLOCK_NONE = 4 + + # Turn off the safety filter. + OFF = 5 + end + end + end + + # Related questions specification. + # @!attribute [rw] enable + # @return [::Boolean] + # Enable related questions feature if true. + class RelatedQuestionsSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Grounding specification. + # @!attribute [rw] include_grounding_supports + # @return [::Boolean] + # Optional. Specifies whether to include grounding_supports in the answer. + # The default value is `false`. + # + # When this field is set to `true`, returned answer will have + # `grounding_score` and will contain GroundingSupports for each claim. + # @!attribute [rw] filtering_level + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec::FilteringLevel] + # Optional. Specifies whether to enable the filtering based on grounding + # score and at what level. + class GroundingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Level to filter based on answer grounding. + module FilteringLevel + # Default is no filter + FILTERING_LEVEL_UNSPECIFIED = 0 + + # Filter answers based on a low threshold. + FILTERING_LEVEL_LOW = 1 + + # Filter answers based on a high threshold. + FILTERING_LEVEL_HIGH = 2 + end + end + + # Answer generation specification. + # @!attribute [rw] model_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec] + # Answer generation model specification. + # @!attribute [rw] prompt_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec] + # Answer generation prompt specification. + # @!attribute [rw] include_citations + # @return [::Boolean] + # Specifies whether to include citation metadata in the answer. The default + # value is `false`. + # @!attribute [rw] answer_language_code + # @return [::String] + # Language code for Answer. Use language tags defined by + # [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + # Note: This is an experimental feature. + # @!attribute [rw] ignore_adversarial_query + # @return [::Boolean] + # Specifies whether to filter out adversarial queries. The default value + # is `false`. + # + # Google employs search-query classification to detect adversarial + # queries. No answer 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 answers for adversarial queries and return + # fallback messages instead. + # @!attribute [rw] ignore_non_answer_seeking_query + # @return [::Boolean] + # Specifies whether to filter out queries that are not answer-seeking. + # The default value is `false`. + # + # Google employs search-query classification to detect answer-seeking + # queries. No answer is returned if the search query is classified as a + # non-answer seeking query. If this field is set to `true`, we skip + # generating answers for non-answer seeking queries and return + # fallback messages instead. + # @!attribute [rw] ignore_low_relevant_content + # @return [::Boolean] + # Specifies whether to filter out queries that have low relevance. + # + # If this field is set to `false`, all search results are used regardless + # of relevance to generate answers. If set to `true` or unset, the behavior + # will be determined automatically by the service. + # @!attribute [rw] ignore_jail_breaking_query + # @return [::Boolean] + # Optional. Specifies whether to filter out jail-breaking queries. The + # default value is `false`. + # + # Google employs search-query classification to detect jail-breaking + # queries. No summary is returned if the search query is classified as a + # jail-breaking query. A user might add instructions to the query to + # change the tone, style, language, content of the answer, or ask the + # model to act as a different entity, e.g. "Reply in the tone of a + # competing company's CEO". If this field is set to `true`, we skip + # generating summaries for jail-breaking queries and return fallback + # messages instead. + class AnswerGenerationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Answer Generation Model specification. + # @!attribute [rw] model_version + # @return [::String] + # Model version. If not set, it will use the default stable model. + # Allowed values are: stable, preview. + class ModelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Answer generation prompt specification. + # @!attribute [rw] preamble + # @return [::String] + # Customized preamble. + class PromptSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Search specification. + # @!attribute [rw] search_params + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams] + # Search parameters. + # + # Note: The following fields are mutually exclusive: `search_params`, `search_result_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] search_result_list + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList] + # Search result list. + # + # Note: The following fields are mutually exclusive: `search_result_list`, `search_params`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SearchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search parameters. + # @!attribute [rw] max_return_results + # @return [::Integer] + # Number of search results to return. + # The default value is 10. + # @!attribute [rw] filter + # @return [::String] + # 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. This will be used to filter + # search results which may affect the Answer response. + # + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key + # to a key property defined in the Vertex AI Search backend -- this + # mapping is defined by the customer in their schema. For example a + # media customers might have a field 'name' in their schema. In this + # case the filter would look like this: filter --> name:'ANY("king + # kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] + # Boost specification to boost certain documents in search results which + # may affect the answer query response. For more information on boosting, + # see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) + # @!attribute [rw] order_by + # @return [::String] + # The order in which documents are returned. Documents can be ordered + # by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} + # object. Leave it unset if ordered by relevance. `order_by` expression + # is case-sensitive. For more information on ordering, see + # [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) + # + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @!attribute [rw] search_result_mode + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode] + # Specifies the search result mode. If unspecified, the + # search result mode defaults to `DOCUMENTS`. + # See [parse and chunk + # documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents) + # @!attribute [rw] data_store_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] + # Specs defining dataStores to filter on in a search call and + # configurations for those dataStores. This is only considered for + # engines with multiple dataStores use case. For single dataStore within + # an engine, they should use the specs at the top level. + class SearchParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Search result list. + # @!attribute [rw] search_results + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>] + # Search results. + class SearchResultList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search result. + # @!attribute [rw] unstructured_document_info + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo] + # Unstructured document information. + # + # Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] chunk_info + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo] + # Chunk information. + # + # Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Unstructured document information. + # @!attribute [rw] document + # @return [::String] + # Document resource name. + # @!attribute [rw] uri + # @return [::String] + # URI for the document. + # @!attribute [rw] title + # @return [::String] + # Title. + # @!attribute [rw] document_contexts + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>] + # List of document contexts. The content will be used for Answer + # Generation. This is supposed to be the main content of the document + # that can be long and comprehensive. + # @!attribute [rw] extractive_segments + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>] + # List of extractive segments. + # @!attribute [rw] extractive_answers + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>] + # Deprecated: This field is deprecated and will have no effect on + # the Answer generation. + # Please use document_contexts and extractive_segments fields. + # List of extractive answers. + class UnstructuredDocumentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document context. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] content + # @return [::String] + # Document content to be used for answer generation. + class DocumentContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Extractive segment. + # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) + # Answer generation will only use it if document_contexts is empty. + # This is supposed to be shorter snippets. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] content + # @return [::String] + # Extractive segment content. + class ExtractiveSegment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Extractive answer. + # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers) + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + # @!attribute [rw] content + # @return [::String] + # Extractive answer content. + class ExtractiveAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Chunk information. + # @!attribute [rw] chunk + # @return [::String] + # Chunk resource name. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. + # @!attribute [rw] document_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata] + # Metadata of the document from the current chunk. + class ChunkInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document metadata contains the information of the document of the + # current chunk. + # @!attribute [rw] uri + # @return [::String] + # Uri of the document. + # @!attribute [rw] title + # @return [::String] + # Title of the document. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + + # Query understanding specification. + # @!attribute [rw] query_classification_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec] + # Query classification specification. + # @!attribute [rw] query_rephraser_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec] + # Query rephraser specification. + # @!attribute [rw] disable_spell_correction + # @return [::Boolean] + # Optional. Whether to disable spell correction. + # The default value is `false`. + class QueryUnderstandingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query classification specification. + # @!attribute [rw] types + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>] + # Enabled query classification types. + class QueryClassificationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query classification types. + module Type + # Unspecified query classification type. + TYPE_UNSPECIFIED = 0 + + # Adversarial query classification type. + ADVERSARIAL_QUERY = 1 + + # Non-answer-seeking query classification type, for chit chat. + NON_ANSWER_SEEKING_QUERY = 2 + + # Jail-breaking query classification type. + JAIL_BREAKING_QUERY = 3 + + # Non-answer-seeking query classification type, for no clear intent. + NON_ANSWER_SEEKING_QUERY_V2 = 4 + + # User defined query classification type. + USER_DEFINED_CLASSIFICATION_QUERY = 5 + end + end + + # Query rephraser specification. + # @!attribute [rw] disable + # @return [::Boolean] + # Disable query rephraser. + # @!attribute [rw] max_rephrase_steps + # @return [::Integer] + # Max rephrase steps. + # The max number is 5 steps. + # If not set or set to < 1, it will be set to 1 by default. + # @!attribute [rw] model_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec] + # Optional. Query Rephraser Model specification. + class QueryRephraserSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query Rephraser Model specification. + # @!attribute [rw] model_type + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec::ModelType] + # Optional. Enabled query rephraser model type. If not set, it will use + # LARGE by default. + class ModelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Query rephraser types. Currently only supports single-hop + # (max_rephrase_steps = 1) model selections. For multi-hop + # (max_rephrase_steps > 1), there is only one default model. + module ModelType + # Unspecified model type. + MODEL_TYPE_UNSPECIFIED = 0 + + # Small query rephraser model. Gemini 1.0 XS model. + SMALL = 1 + + # Large query rephraser model. Gemini 1.0 Pro model. + LARGE = 2 + end + end + end + end + + # End user specification. + # @!attribute [rw] end_user_metadata + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData>] + # Optional. End user metadata. + class EndUserSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # End user metadata. + # @!attribute [rw] chunk_info + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo] + # Chunk information. + class EndUserMetaData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Chunk information. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. It is limited to 8000 characters. + # @!attribute [rw] document_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo::DocumentMetadata] + # Metadata of the document from the current chunk. + class ChunkInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Document metadata contains the information of the document of + # the current chunk. + # @!attribute [rw] title + # @return [::String] + # Title of the document. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery} + # method. + # @!attribute [rw] answer + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] + # Answer resource object. + # If + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec#max_rephrase_steps AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps} + # is greater than 1, use + # {::Google::Cloud::DiscoveryEngine::V1::Answer#name Answer.name} to fetch answer + # information using + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} + # API. + # @!attribute [rw] session + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # Session resource object. + # It will be only available when session field is set and valid in the + # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} + # request. + # @!attribute [rw] answer_query_token + # @return [::String] + # A global unique ID used for logging. + class AnswerQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetAnswer method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Answer to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` + class GetAnswerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for CreateSession method. + # @!attribute [rw] parent + # @return [::String] + # Required. Full resource name of parent data store. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @!attribute [rw] session + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # Required. The session to create. + class CreateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for UpdateSession method. + # @!attribute [rw] session + # @return [::Google::Cloud::DiscoveryEngine::V1::Session] + # Required. The Session to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following + # are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} + # + # If not set or empty, all supported fields are updated. + class UpdateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for DeleteSession method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Session to delete. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + class DeleteSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for GetSession method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Session to get. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` + # @!attribute [rw] include_answer_details + # @return [::Boolean] + # Optional. If set to true, the full session including all answer details + # will be returned. + class GetSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ListSessions method. + # @!attribute [rw] parent + # @return [::String] + # Required. The data store resource name. Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of results to return. If unspecified, defaults + # to 50. Max allowed value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListSessions` call. + # Provide this to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # A comma-separated list of fields to filter by, in EBNF grammar. + # The supported fields are: + # * `user_pseudo_id` + # * `state` + # * `display_name` + # * `starred` + # * `is_pinned` + # * `labels` + # * `create_time` + # * `update_time` + # + # Examples: + # "user_pseudo_id = some_id" + # "display_name = \"some_name\"" + # "starred = true" + # "is_pinned=true AND (NOT labels:hidden)" + # "create_time > \"1970-01-01T12:00:00Z\"" + # @!attribute [rw] order_by + # @return [::String] + # 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` + # * `session_name` + # * `is_pinned` + # + # Example: + # + # * "update_time desc" + # * "create_time" + # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then + # by update_time. + class ListSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for ListSessions method. + # @!attribute [rw] sessions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Session>] + # All the Sessions for a given data store. + # @!attribute [rw] next_page_token + # @return [::String] + # Pagination token, if not returned indicates the last page. + class ListSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb new file mode 100644 index 000000000000..c8797885f8f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Metadata that describes a custom tuned model. + # @!attribute [rw] name + # @return [::String] + # Required. The fully qualified resource name of the model. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. + # + # Model must be an alpha-numerical string with limit of 40 characters. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the model. + # @!attribute [rw] model_version + # @return [::Integer] + # The version of the model. + # @!attribute [rw] model_state + # @return [::Google::Cloud::DiscoveryEngine::V1::CustomTuningModel::ModelState] + # The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). + # @!attribute [rw] create_time + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Timestamp] + # Deprecated: Timestamp the Model was created at. + # @!attribute [rw] training_start_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp the model training was initiated. + # @!attribute [rw] metrics + # @return [::Google::Protobuf::Map{::String => ::Float}] + # The metrics of the trained model. + # @!attribute [rw] error_message + # @return [::String] + # Currently this is only populated if the model state is + # `INPUT_VALIDATION_FAILED`. + class CustomTuningModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class MetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of the model. + module ModelState + # Default value. + MODEL_STATE_UNSPECIFIED = 0 + + # The model is in a paused training state. + TRAINING_PAUSED = 1 + + # The model is currently training. + TRAINING = 2 + + # The model has successfully completed training. + TRAINING_COMPLETE = 3 + + # The model is ready for serving. + READY_FOR_SERVING = 4 + + # The model training failed. + TRAINING_FAILED = 5 + + # The model training finished successfully but metrics did not improve. + NO_IMPROVEMENT = 6 + + # Input data validation failed. Model training didn't start. + INPUT_VALIDATION_FAILED = 7 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb new file mode 100644 index 000000000000..23e60a59bb16 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb @@ -0,0 +1,288 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # DataStore captures global settings and configs at the DataStore level. + # @!attribute [rw] name + # @return [::String] + # Immutable. Identifier. The full resource name of the data store. + # Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # This field must be a UTF-8 encoded string with a length limit of 1024 + # characters. + # @!attribute [rw] display_name + # @return [::String] + # Required. The data store display name. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] industry_vertical + # @return [::Google::Cloud::DiscoveryEngine::V1::IndustryVertical] + # Immutable. The industry vertical that the data store registers. + # @!attribute [rw] solution_types + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SolutionType>] + # The solutions that the data store enrolls. Available solutions for each + # {::Google::Cloud::DiscoveryEngine::V1::DataStore#industry_vertical industry_vertical}: + # + # * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and `SOLUTION_TYPE_SEARCH`. + # * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is automatically enrolled. Other + # solutions cannot be enrolled. + # @!attribute [r] default_schema_id + # @return [::String] + # Output only. The id of the default + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} associated to this data + # store. + # @!attribute [rw] content_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig] + # Immutable. The content config of the data store. If this field is unset, + # the server behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::NO_CONTENT ContentConfig.NO_CONTENT}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} was created at. + # @!attribute [rw] advanced_site_search_config + # @return [::Google::Cloud::DiscoveryEngine::V1::AdvancedSiteSearchConfig] + # Optional. Configuration for advanced site search. + # @!attribute [rw] natural_language_query_understanding_config + # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig] + # Optional. Configuration for Natural Language Query Understanding. + # @!attribute [rw] kms_key_name + # @return [::String] + # Input only. The KMS key to be used to protect this DataStore at creation + # time. + # + # Must be set for requests that need to comply with CMEK Org Policy + # protections. + # + # If this field is set and processed successfully, the DataStore will be + # protected by the KMS key, as indicated in the cmek_config field. + # @!attribute [r] cmek_config + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # Output only. CMEK-related information for the DataStore. + # @!attribute [r] billing_estimation + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore::BillingEstimation] + # Output only. Data size estimation for billing. + # @!attribute [rw] acl_enabled + # @return [::Boolean] + # Immutable. Whether data in the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} has ACL information. + # If set to `true`, the source data must have ACL. ACL will be ingested when + # data is ingested by + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents DocumentService.ImportDocuments} + # methods. + # + # When ACL is enabled for the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} can't be accessed by + # calling + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} + # or + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments}. + # + # Currently ACL is only supported in `GENERIC` industry vertical with + # non-`PUBLIC_WEBSITE` content config. + # @!attribute [rw] workspace_config + # @return [::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig] + # Config to store data store type configuration for workspace data. This + # must be set when + # {::Google::Cloud::DiscoveryEngine::V1::DataStore#content_config DataStore.content_config} + # is set as + # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::GOOGLE_WORKSPACE DataStore.ContentConfig.GOOGLE_WORKSPACE}. + # @!attribute [rw] document_processing_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig] + # Configuration for Document understanding and enrichment. + # @!attribute [rw] starting_schema + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # The start schema to use for this + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} when provisioning + # it. If unset, a default vertical specialized schema will be used. + # + # This field is only used by + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store CreateDataStore} + # API, and will be ignored if used in other APIs. This field will be omitted + # from all API responses including + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store CreateDataStore} + # API. To retrieve a schema of a + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, use + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema SchemaService.GetSchema} + # API instead. + # + # The provided schema will be validated against certain rules on schema. + # Learn more from [this + # doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema). + # @!attribute [rw] healthcare_fhir_config + # @return [::Google::Cloud::DiscoveryEngine::V1::HealthcareFhirConfig] + # Optional. Configuration for `HEALTHCARE_FHIR` vertical. + # @!attribute [rw] identity_mapping_store + # @return [::String] + # Immutable. The fully qualified resource name of the associated + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore IdentityMappingStore}. + # This field can only be set for acl_enabled DataStores with `THIRD_PARTY` or + # `GSUITE` IdP. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}`. + class DataStore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Estimation of data size per data store. + # @!attribute [rw] structured_data_size + # @return [::Integer] + # Data size for structured data in terms of bytes. + # @!attribute [rw] unstructured_data_size + # @return [::Integer] + # Data size for unstructured data in terms of bytes. + # @!attribute [rw] website_data_size + # @return [::Integer] + # Data size for websites in terms of bytes. + # @!attribute [rw] structured_data_update_time + # @return [::Google::Protobuf::Timestamp] + # Last updated timestamp for structured data. + # @!attribute [rw] unstructured_data_update_time + # @return [::Google::Protobuf::Timestamp] + # Last updated timestamp for unstructured data. + # @!attribute [rw] website_data_update_time + # @return [::Google::Protobuf::Timestamp] + # Last updated timestamp for websites. + class BillingEstimation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Content config of the data store. + module ContentConfig + # Default value. + CONTENT_CONFIG_UNSPECIFIED = 0 + + # Only contains documents without any + # {::Google::Cloud::DiscoveryEngine::V1::Document#content Document.content}. + NO_CONTENT = 1 + + # Only contains documents with + # {::Google::Cloud::DiscoveryEngine::V1::Document#content Document.content}. + CONTENT_REQUIRED = 2 + + # The data store is used for public website search. + PUBLIC_WEBSITE = 3 + + # The data store is used for workspace search. Details of workspace + # data store are specified in the + # {::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig WorkspaceConfig}. + GOOGLE_WORKSPACE = 4 + end + end + + # Configuration data for advance site search. + # @!attribute [rw] disable_initial_index + # @return [::Boolean] + # If set true, initial indexing is disabled for the DataStore. + # @!attribute [rw] disable_automatic_refresh + # @return [::Boolean] + # If set true, automatic refresh is disabled for the DataStore. + class AdvancedSiteSearchConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for Natural Language Query Understanding. + # @!attribute [rw] mode + # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode] + # Mode of Natural Language Query Understanding. If this field is unset, the + # behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode::DISABLED NaturalLanguageQueryUnderstandingConfig.Mode.DISABLED}. + class NaturalLanguageQueryUnderstandingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mode of Natural Language Query Understanding. When the + # NaturalLanguageQueryUnderstandingConfig.Mode is ENABLED, the natural + # language understanding capabilities will be enabled for a search request if + # the NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition in the + # SearchRequest is ENABLED. + module Mode + # Default value. + MODE_UNSPECIFIED = 0 + + # Natural Language Query Understanding is disabled. + DISABLED = 1 + + # Natural Language Query Understanding is enabled. + ENABLED = 2 + end + end + + # Config to store data store type configuration for workspace data + # @!attribute [rw] type + # @return [::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig::Type] + # The Google Workspace data source. + # @!attribute [rw] dasher_customer_id + # @return [::String] + # Obfuscated Dasher customer ID. + # @!attribute [rw] super_admin_service_account + # @return [::String] + # Optional. The super admin service account for the workspace that will be + # used for access token generation. For now we only use it for Native Google + # Drive connector data ingestion. + # @!attribute [rw] super_admin_email_address + # @return [::String] + # Optional. The super admin email address for the workspace that will be used + # for access token generation. For now we only use it for Native Google Drive + # connector data ingestion. + class WorkspaceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the type of Workspace App supported by this DataStore + module Type + # Defaults to an unspecified Workspace type. + TYPE_UNSPECIFIED = 0 + + # Workspace Data Store contains Drive data + GOOGLE_DRIVE = 1 + + # Workspace Data Store contains Mail data + GOOGLE_MAIL = 2 + + # Workspace Data Store contains Sites data + GOOGLE_SITES = 3 + + # Workspace Data Store contains Calendar data + GOOGLE_CALENDAR = 4 + + # Workspace Data Store contains Chat data + GOOGLE_CHAT = 5 + + # Workspace Data Store contains Groups data + GOOGLE_GROUPS = 6 + + # Workspace Data Store contains Keep data + GOOGLE_KEEP = 7 + + # Workspace Data Store contains People data + GOOGLE_PEOPLE = 8 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb new file mode 100644 index 000000000000..40ab5de7c17f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb @@ -0,0 +1,236 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store DataStoreService.CreateDataStore} + # method. + # @!attribute [rw] cmek_config_name + # @return [::String] + # Resource name of the CmekConfig to use for protecting this DataStore. + # + # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disable_cmek + # @return [::Boolean] + # DataStore without CMEK protections. If a default CmekConfig is set for + # the project, setting this field will override the default CmekConfig as + # well. + # + # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @!attribute [rw] data_store + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # create. + # @!attribute [rw] data_store_id + # @return [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become + # the final component of the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. + # + # 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. + # @!attribute [rw] create_advanced_site_search + # @return [::Boolean] + # A boolean flag indicating whether user want to directly create an advanced + # data store for site search. + # If the data store is not configured as site + # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will + # be ignored. + # @!attribute [rw] skip_default_schema_creation + # @return [::Boolean] + # A boolean flag indicating whether to skip the default schema creation for + # the data store. Only enable this flag if you are certain that the default + # schema is incompatible with your use case. + # + # If set to true, you must manually create a schema for the data store before + # any documents can be ingested. + # + # This flag cannot be specified if `data_store.starting_schema` is specified. + class CreateDataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store DataStoreService.GetDataStore} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} + # does not exist, a NOT_FOUND error is returned. + class GetDataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store DataStoreService.CreateDataStore} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class CreateDataStoreMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this + # location, regardless of whether or not this data store exists, a + # PERMISSION_DENIED error is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s + # to return. If unspecified, defaults to 10. The maximum allowed value is 50. + # Values above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # must match the call that provided the page token. Otherwise, an + # INVALID_ARGUMENT error is returned. + # @!attribute [rw] filter + # @return [::String] + # Filter by solution type . + # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` + class ListDataStoresRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} + # method. + # @!attribute [rw] data_stores + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DataStore>] + # All the customer's {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest#page_token ListDataStoresRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListDataStoresResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store DataStoreService.DeleteDataStore} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete + # does not exist, a NOT_FOUND error is returned. + class DeleteDataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store DataStoreService.UpdateDataStore} + # method. + # @!attribute [rw] data_store + # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to + # update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update + # does not exist, a NOT_FOUND error is returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + class UpdateDataStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store DataStoreService.DeleteDataStore} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteDataStoreMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb new file mode 100644 index 000000000000..117c02911cc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Document captures all raw metadata information of items to be recommended or + # searched. + # @!attribute [rw] struct_data + # @return [::Google::Protobuf::Struct] + # The structured JSON data for the document. It should conform to the + # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an + # `INVALID_ARGUMENT` error is thrown. + # + # Note: The following fields are mutually exclusive: `struct_data`, `json_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] json_data + # @return [::String] + # The JSON string representation of the document. It should conform to the + # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an + # `INVALID_ARGUMENT` error is thrown. + # + # Note: The following fields are mutually exclusive: `json_data`, `struct_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # 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. + # @!attribute [rw] id + # @return [::String] + # Immutable. The identifier of the document. + # + # Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) + # standard with a length limit of 128 characters. + # @!attribute [rw] schema_id + # @return [::String] + # The identifier of the schema located in the same data store. + # @!attribute [rw] content + # @return [::Google::Cloud::DiscoveryEngine::V1::Document::Content] + # The unstructured data linked to this document. Content can only be set + # and must be set if this document is under a `CONTENT_REQUIRED` data store. + # @!attribute [rw] parent_document_id + # @return [::String] + # 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. + # @!attribute [r] derived_struct_data + # @return [::Google::Protobuf::Struct] + # Output only. This field is OUTPUT_ONLY. + # It contains derived data that are not in the original input document. + # @!attribute [rw] acl_info + # @return [::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo] + # Access control information for the document. + # @!attribute [r] index_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the document was indexed. If this field is set, + # the document could be returned in search results. + # + # This field is OUTPUT_ONLY. If this field is not populated, it means the + # document has never been indexed. + # @!attribute [r] index_status + # @return [::Google::Cloud::DiscoveryEngine::V1::Document::IndexStatus] + # Output only. The index status of the document. + # + # * If document is indexed successfully, the index_time field is populated. + # * Otherwise, if document is not indexed due to errors, the error_samples + # field is populated. + # * Otherwise, if document's index is in progress, the pending_message field + # is populated. + class Document + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Unstructured data linked to this document. + # @!attribute [rw] raw_bytes + # @return [::String] + # 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. + # + # Note: The following fields are mutually exclusive: `raw_bytes`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # The URI of the content. Only Cloud Storage URIs (e.g. + # `gs://bucket-name/path/to/file`) are supported. The maximum file size + # is 2.5 MB for text-based formats, 200 MB for other formats. + # + # Note: The following fields are mutually exclusive: `uri`, `raw_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mime_type + # @return [::String] + # The MIME type of the content. Supported types: + # + # * `application/pdf` (PDF, only native PDFs are supported for now) + # * `text/html` (HTML) + # * `text/plain` (TXT) + # * `application/xml` or `text/xml` (XML) + # * `application/json` (JSON) + # * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) + # * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) + # * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` + # (XLSX) + # * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) + # + # The following types are supported only if layout parser is enabled in the + # data store: + # + # * `image/bmp` (BMP) + # * `image/gif` (GIF) + # * `image/jpeg` (JPEG) + # * `image/png` (PNG) + # * `image/tiff` (TIFF) + # + # See https://www.iana.org/assignments/media-types/media-types.xhtml. + class Content + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ACL Information of the Document. + # @!attribute [rw] readers + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo::AccessRestriction>] + # Readers of the document. + class AclInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # AclRestriction to model complex inheritance restrictions. + # + # Example: Modeling a "Both Permit" inheritance, where to access a + # child document, user needs to have access to parent document. + # + # Document Hierarchy - Space_S --> Page_P. + # + # Readers: + # Space_S: group_1, user_1 + # Page_P: group_2, group_3, user_2 + # + # Space_S ACL Restriction - + # { + # "acl_info": { + # "readers": [ + # { + # "principals": [ + # { + # "group_id": "group_1" + # }, + # { + # "user_id": "user_1" + # } + # ] + # } + # ] + # } + # } + # + # Page_P ACL Restriction. + # { + # "acl_info": { + # "readers": [ + # { + # "principals": [ + # { + # "group_id": "group_2" + # }, + # { + # "group_id": "group_3" + # }, + # { + # "user_id": "user_2" + # } + # ], + # }, + # { + # "principals": [ + # { + # "group_id": "group_1" + # }, + # { + # "user_id": "user_1" + # } + # ], + # } + # ] + # } + # } + # @!attribute [rw] principals + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Principal>] + # List of principals. + # @!attribute [rw] idp_wide + # @return [::Boolean] + # All users within the Identity Provider. + class AccessRestriction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Index status of the document. + # @!attribute [rw] index_time + # @return [::Google::Protobuf::Timestamp] + # The time when the document was indexed. + # If this field is populated, it means the document has been indexed. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while indexing the document. + # If this field is populated, the document is not indexed due to errors. + # @!attribute [rw] pending_message + # @return [::String] + # Immutable. The message indicates the document index is in progress. + # If this field is populated, the document index is pending. + class IndexStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb new file mode 100644 index 000000000000..3009873d1c17 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb @@ -0,0 +1,176 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # A singleton resource of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. If it's empty when + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is created and + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is set to + # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}, + # the default parser will default to digital parser. + # @!attribute [rw] name + # @return [::String] + # The full resource name of the Document Processing Config. + # Format: + # `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. + # @!attribute [rw] chunking_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ChunkingConfig] + # Whether chunking mode is enabled. + # @!attribute [rw] default_parsing_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig] + # Configurations for default Document parser. + # If not specified, we will configure it as default DigitalParsingConfig, and + # the default parsing config will be applied to all file types for Document + # parsing. + # @!attribute [rw] parsing_config_overrides + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig}] + # Map from file type to override the default parsing configuration based on + # the file type. Supported keys: + # + # * `pdf`: Override parsing config for PDF files, either digital parsing, ocr + # parsing or layout parsing is supported. + # * `html`: Override parsing config for HTML files, only digital parsing and + # layout parsing are supported. + # * `docx`: Override parsing config for DOCX files, only digital parsing and + # layout parsing are supported. + # * `pptx`: Override parsing config for PPTX files, only digital parsing and + # layout parsing are supported. + # * `xlsm`: Override parsing config for XLSM files, only digital parsing and + # layout parsing are supported. + # * `xlsx`: Override parsing config for XLSX files, only digital parsing and + # layout parsing are supported. + class DocumentProcessingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for chunking config. + # @!attribute [rw] layout_based_chunking_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ChunkingConfig::LayoutBasedChunkingConfig] + # Configuration for the layout based chunking. + class ChunkingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for the layout based chunking. + # @!attribute [rw] chunk_size + # @return [::Integer] + # The token size limit for each chunk. + # + # Supported values: 100-500 (inclusive). + # Default value: 500. + # @!attribute [rw] include_ancestor_headings + # @return [::Boolean] + # Whether to include appending different levels of headings to chunks + # from the middle of the document to prevent context loss. + # + # Default value: False. + class LayoutBasedChunkingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Related configurations applied to a specific type of document parser. + # @!attribute [rw] digital_parsing_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig] + # Configurations applied to digital parser. + # + # Note: The following fields are mutually exclusive: `digital_parsing_config`, `ocr_parsing_config`, `layout_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ocr_parsing_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::OcrParsingConfig] + # Configurations applied to OCR parser. Currently it only applies to + # PDFs. + # + # Note: The following fields are mutually exclusive: `ocr_parsing_config`, `digital_parsing_config`, `layout_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] layout_parsing_config + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::LayoutParsingConfig] + # Configurations applied to layout parser. + # + # Note: The following fields are mutually exclusive: `layout_parsing_config`, `digital_parsing_config`, `ocr_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The digital parsing configurations for documents. + class DigitalParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The OCR parsing configurations for documents. + # @!attribute [rw] enhanced_document_elements + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # [DEPRECATED] This field is deprecated. To use the additional enhanced + # document elements processing, please switch to `layout_parsing_config`. + # @!attribute [rw] use_native_text + # @return [::Boolean] + # If true, will use native text instead of OCR text on pages containing + # native text. + class OcrParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The layout parsing configurations for documents. + # @!attribute [rw] enable_table_annotation + # @return [::Boolean] + # Optional. If true, the LLM based annotation is added to the table + # during parsing. + # @!attribute [rw] enable_image_annotation + # @return [::Boolean] + # Optional. If true, the LLM based annotation is added to the image + # during parsing. + # @!attribute [rw] structured_content_types + # @return [::Array<::String>] + # Optional. Contains the required structure types to extract from the + # document. Supported values: + # + # * `shareholder-structure` + # @!attribute [rw] exclude_html_elements + # @return [::Array<::String>] + # Optional. List of HTML elements to exclude from the parsed content. + # @!attribute [rw] exclude_html_classes + # @return [::Array<::String>] + # Optional. List of HTML classes to exclude from the parsed content. + # @!attribute [rw] exclude_html_ids + # @return [::Array<::String>] + # Optional. List of HTML ids to exclude from the parsed content. + class LayoutParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig] + class ParsingConfigOverridesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb new file mode 100644 index 000000000000..9202f2b69084 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb @@ -0,0 +1,313 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does + # not exist, a `NOT_FOUND` error is returned. + class GetDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # method. + # @!attribute [rw] parent + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, + # regardless of whether or not this branch exists, a `PERMISSION_DENIED` + # error is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. If unspecified, defaults to 100. The maximum allowed value is 1000. + # Values above 1000 are set to 1000. + # + # If this field is negative, an `INVALID_ARGUMENT` error is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, + # received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + class ListDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} + # method. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document>] + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest#page_token ListDocumentsRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document DocumentService.CreateDocument} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @!attribute [rw] document + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to + # create. + # @!attribute [rw] document_id + # @return [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the + # final component of the + # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. + # + # If the caller does not have permission to create the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # This field must be unique among all + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same + # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + class CreateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document DocumentService.UpdateDocument} + # method. + # @!attribute [rw] document + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # Required. The document to update/create. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does + # not exist and + # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} + # is not set, a `NOT_FOUND` error is returned. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to `true` and the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided imported 'document' to update. If + # not set, by default updates all fields. + class UpdateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document DocumentService.DeleteDocument} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether + # or not it exists, a `PERMISSION_DENIED` error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does + # not exist, a `NOT_FOUND` error is returned. + class DeleteDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata DocumentService.BatchGetDocumentsMetadata} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @!attribute [rw] matcher + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher] + # Required. Matcher for the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + class BatchGetDocumentsMetadataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s by + # exact uris. + # @!attribute [rw] uris + # @return [::Array<::String>] + # The exact URIs to match by. + class UrisMatcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s by + # FHIR resource names. + # @!attribute [rw] fhir_resources + # @return [::Array<::String>] + # Required. The FHIR resources to match by. + # Format: + # projects/\\{project}/locations/\\{location}/datasets/\\{dataset}/fhirStores/\\{fhir_store}/fhir/\\{resource_type}/\\{fhir_resource_id} + class FhirMatcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + # Currently supports matching by exact URIs. + # @!attribute [rw] uris_matcher + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::UrisMatcher] + # Matcher by exact URIs. + # + # Note: The following fields are mutually exclusive: `uris_matcher`, `fhir_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] fhir_matcher + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::FhirMatcher] + # Matcher by FHIR resource names. + # + # Note: The following fields are mutually exclusive: `fhir_matcher`, `uris_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Matcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata DocumentService.BatchGetDocumentsMetadata} + # method. + # @!attribute [rw] documents_metadata + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::DocumentMetadata>] + # The metadata of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. + class BatchGetDocumentsMetadataResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The metadata of a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # @!attribute [rw] matcher_value + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::DocumentMetadata::MatcherValue] + # The value of the matcher that was used to match the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::State] + # The state of the document. + # @!attribute [rw] last_refreshed_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp of the last time the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} was last indexed. + # @!attribute [rw] data_ingestion_source + # @return [::String] + # The data ingestion source of the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # Allowed values are: + # + # * `batch`: Data ingested via Batch API, e.g., ImportDocuments. + # * `streaming` Data ingested via Streaming API, e.g., FHIR streaming. + class DocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The value of the matcher that was used to match the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # @!attribute [rw] uri + # @return [::String] + # If match by URI, the URI of the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # + # Note: The following fields are mutually exclusive: `uri`, `fhir_resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] fhir_resource + # @return [::String] + # Format: + # projects/\\{project}/locations/\\{location}/datasets/\\{dataset}/fhirStores/\\{fhir_store}/fhir/\\{resource_type}/\\{fhir_resource_id} + # + # Note: The following fields are mutually exclusive: `fhir_resource`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class MatcherValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The state of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + module State + # Should never be set. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is indexed. + INDEXED = 1 + + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not indexed + # because its URI is not in the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. + NOT_IN_TARGET_SITE = 2 + + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not indexed. + NOT_IN_INDEX = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb new file mode 100644 index 000000000000..24ae3add7c9f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb @@ -0,0 +1,371 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Metadata that describes the training and serving parameters of an + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. + # @!attribute [rw] chat_engine_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineConfig] + # Configurations for the Chat Engine. Only applicable if + # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}. + # + # Note: The following fields are mutually exclusive: `chat_engine_config`, `search_engine_config`, `media_recommendation_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] search_engine_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::SearchEngineConfig] + # Configurations for the Search Engine. Only applicable if + # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # + # Note: The following fields are mutually exclusive: `search_engine_config`, `chat_engine_config`, `media_recommendation_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] media_recommendation_engine_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig] + # Configurations for the Media Engine. Only applicable on the data + # stores with + # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION} + # and + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # + # Note: The following fields are mutually exclusive: `media_recommendation_engine_config`, `chat_engine_config`, `search_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] chat_engine_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineMetadata] + # Output only. Additional information of the Chat Engine. Only applicable + # if {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} + # is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}. + # @!attribute [rw] name + # @return [::String] + # Immutable. Identifier. The fully qualified resource name of the engine. + # + # This field must be a UTF-8 encoded string with a length limit of 1024 + # characters. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` + # engine should be 1-63 characters, and valid characters are + # /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the engine. Should be human readable. UTF-8 + # encoded string with limit of 1024 characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp the Recommendation Engine was created at. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp the Recommendation Engine was last updated. + # @!attribute [rw] data_store_ids + # @return [::Array<::String>] + # Optional. The data stores associated with this engine. + # + # For + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH} + # and + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION} + # type of engines, they can only associate with at most one data store. + # + # If {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}, + # multiple {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s in the + # same [Collection][google.cloud.discoveryengine.v1.Collection] can be + # associated here. + # + # Note that when used in + # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest CreateEngineRequest}, + # one DataStore id must be provided as the system will use it for necessary + # initializations. + # @!attribute [rw] solution_type + # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] + # Required. The solutions of the engine. + # @!attribute [rw] industry_vertical + # @return [::Google::Cloud::DiscoveryEngine::V1::IndustryVertical] + # Optional. The industry vertical that the engine registers. + # The restriction of the Engine industry vertical is based on + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}: Vertical on Engine + # has to match vertical of the DataStore linked to the engine. + # @!attribute [rw] common_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::CommonConfig] + # Common config spec that specifies the metadata of the engine. + # @!attribute [rw] disable_analytics + # @return [::Boolean] + # Optional. Whether to disable analytics for searches performed on this + # engine. + class Engine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configurations for a Search Engine. + # @!attribute [rw] search_tier + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTier] + # The search feature tier of this engine. + # + # Different tiers might have different + # pricing. To learn more, check the pricing documentation. + # + # Defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchTier::SEARCH_TIER_STANDARD SearchTier.SEARCH_TIER_STANDARD} + # if not specified. + # @!attribute [rw] search_add_ons + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchAddOn>] + # The add-on that this search engine enables. + class SearchEngineConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional config specs for a Media Recommendation engine. + # @!attribute [rw] type + # @return [::String] + # Required. The type of engine. e.g., `recommended-for-you`. + # + # This field together with + # {::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig#optimization_objective optimization_objective} + # describe engine metadata to use to control engine training and serving. + # + # Currently supported values: `recommended-for-you`, `others-you-may-like`, + # `more-like-this`, `most-popular-items`. + # @!attribute [rw] optimization_objective + # @return [::String] + # The optimization objective. e.g., `cvr`. + # + # This field together with + # {::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig#type optimization_objective} + # describe engine metadata to use to control engine training and serving. + # + # Currently supported + # values: `ctr`, `cvr`. + # + # If not specified, we choose default based on engine type. + # Default depends on type of recommendation: + # + # `recommended-for-you` => `ctr` + # + # `others-you-may-like` => `ctr` + # @!attribute [rw] optimization_objective_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::OptimizationObjectiveConfig] + # Name and value of the custom threshold for cvr optimization_objective. + # For target_field `watch-time`, target_field_value must be an integer + # value indicating the media progress time in seconds between (0, 86400] + # (excludes 0, includes 86400) (e.g., 90). + # For target_field `watch-percentage`, the target_field_value must be a + # valid float value between (0, 1.0] (excludes 0, includes 1.0) (e.g., + # 0.5). + # @!attribute [rw] training_state + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::TrainingState] + # The training state that the engine is in (e.g. + # `TRAINING` or `PAUSED`). + # + # Since part of the cost of running the service + # is frequency of training - this can be used to determine when to train + # engine in order to control cost. If not specified: the default value for + # `CreateEngine` method is `TRAINING`. The default value for + # `UpdateEngine` method is to keep the state the same as before. + # @!attribute [rw] engine_features_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::EngineFeaturesConfig] + # Optional. Additional engine features config. + class MediaRecommendationEngineConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Custom threshold for `cvr` optimization_objective. + # @!attribute [rw] target_field + # @return [::String] + # Required. The name of the field to target. Currently supported + # values: `watch-percentage`, `watch-time`. + # @!attribute [rw] target_field_value_float + # @return [::Float] + # Required. The threshold to be applied to the target (e.g., 0.5). + class OptimizationObjectiveConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # More feature configs of the selected engine type. + # @!attribute [rw] recommended_for_you_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::RecommendedForYouFeatureConfig] + # Recommended for you engine feature config. + # + # Note: The following fields are mutually exclusive: `recommended_for_you_config`, `most_popular_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] most_popular_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::MostPopularFeatureConfig] + # Most popular engine feature config. + # + # Note: The following fields are mutually exclusive: `most_popular_config`, `recommended_for_you_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class EngineFeaturesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional feature configurations for creating a `recommended-for-you` + # engine. + # @!attribute [rw] context_event_type + # @return [::String] + # The type of event with which the engine is queried at prediction time. + # If set to `generic`, only `view-item`, `media-play`,and + # `media-complete` will be used as `context-event` in engine training. If + # set to `view-home-page`, `view-home-page` will also be used as + # `context-events` in addition to `view-item`, `media-play`, and + # `media-complete`. Currently supported for the `recommended-for-you` + # engine. Currently supported values: `view-home-page`, `generic`. + class RecommendedForYouFeatureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Feature configurations that are required for creating a Most Popular + # engine. + # @!attribute [rw] time_window_days + # @return [::Integer] + # The time window of which the engine is queried at training and + # prediction time. Positive integers only. The value translates to the + # last X days of events. Currently required for the `most-popular-items` + # engine. + class MostPopularFeatureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The training state of the engine. + module TrainingState + # Unspecified training state. + TRAINING_STATE_UNSPECIFIED = 0 + + # The engine training is paused. + PAUSED = 1 + + # The engine is training. + TRAINING = 2 + end + end + + # Configurations for a Chat Engine. + # @!attribute [rw] agent_creation_config + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineConfig::AgentCreationConfig] + # The configurationt generate the Dialogflow agent that is associated to + # this Engine. + # + # Note that these configurations are one-time consumed by + # and passed to Dialogflow service. It means they cannot be retrieved using + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} + # or + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # API after engine creation. + # @!attribute [rw] dialogflow_agent_to_link + # @return [::String] + # The resource name of an exist Dialogflow agent to link to this Chat + # Engine. Customers can either provide `agent_creation_config` to create + # agent or provide an agent name that links the agent with the Chat engine. + # + # Format: `projects//locations//agents/`. + # + # Note that the `dialogflow_agent_to_link` are one-time consumed by and + # passed to Dialogflow service. It means they cannot be retrieved using + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} + # or + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # API after engine creation. Use + # {::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineMetadata#dialogflow_agent ChatEngineMetadata.dialogflow_agent} + # for actual agent association after Engine is created. + # @!attribute [rw] allow_cross_region + # @return [::Boolean] + # Optional. If the flag set to true, we allow the agent and engine are in + # different locations, otherwise the agent and engine are required to be in + # the same location. The flag is set to false by default. + # + # Note that the `allow_cross_region` are one-time consumed by and + # passed to + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine}. + # It means they cannot be retrieved using + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} + # or + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # API after engine creation. + class ChatEngineConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configurations for generating a Dialogflow agent. + # + # Note that these configurations are one-time consumed by + # and passed to Dialogflow service. It means they cannot be retrieved using + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} + # or + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # API after engine creation. + # @!attribute [rw] business + # @return [::String] + # Name of the company, organization or other entity that the agent + # represents. Used for knowledge connector LLM prompt and for knowledge + # search. + # @!attribute [rw] default_language_code + # @return [::String] + # Required. The default language of the agent as a language tag. + # See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. + # @!attribute [rw] time_zone + # @return [::String] + # Required. The time zone of the agent from the [time zone + # database](https://www.iana.org/time-zones), e.g., America/New_York, + # Europe/Paris. + # @!attribute [rw] location + # @return [::String] + # Agent location for Agent creation, supported values: global/us/eu. + # If not provided, us Engine will create Agent using us-central-1 by + # default; eu Engine will create Agent using eu-west-1 by default. + class AgentCreationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Common configurations for an Engine. + # @!attribute [rw] company_name + # @return [::String] + # The name of the company, business or entity that is associated with the + # engine. Setting this may help improve LLM related features. + class CommonConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional information of a Chat Engine. + # Fields in this message are output only. + # @!attribute [rw] dialogflow_agent + # @return [::String] + # The resource name of a Dialogflow agent, that this Chat Engine refers + # to. + # + # Format: `projects//locations//agents/`. + class ChatEngineMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb new file mode 100644 index 000000000000..08d3e850460c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb @@ -0,0 +1,177 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}`. + # @!attribute [rw] engine + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. + # @!attribute [rw] engine_id + # @return [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the + # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s + # resource name. + # + # 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. + class CreateEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class CreateEngineMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine EngineService.DeleteEngine} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # + # If the caller does not have permission to delete the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not + # exist, a NOT_FOUND error is returned. + class DeleteEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine EngineService.DeleteEngine} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteEngineMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + class GetEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection_id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Not supported. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Not supported. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter by solution type. For example: + # solution_type=SOLUTION_TYPE_SEARCH + class ListEnginesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} + # method. + # @!attribute [rw] engines + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Engine>] + # All the customer's {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s. + # @!attribute [rw] next_page_token + # @return [::String] + # Not supported. + class ListEnginesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine EngineService.UpdateEngine} + # method. + # @!attribute [rw] engine + # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or + # not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not + # exist, a NOT_FOUND error is returned. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. + # + # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error + # is returned. + class UpdateEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb new file mode 100644 index 000000000000..a3e1deb33767 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb @@ -0,0 +1,620 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Base structured datatype containing multi-part content of a message. + # @!attribute [rw] role + # @return [::String] + # Producer of the content. Must be either `user` or `model`. + # + # Intended to be used for multi-turn conversations. Otherwise, it can be left + # unset. + # @!attribute [rw] parts + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent::Part>] + # Ordered `Parts` that constitute a single message. + class GroundedGenerationContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Single part of content. + # @!attribute [rw] text + # @return [::String] + # Inline text. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Top-level message sent by the client for the `GenerateGroundedContent` + # method. + # @!attribute [rw] location + # @return [::String] + # Required. Location resource. + # + # Format: `projects/{project}/locations/{location}`. + # @!attribute [rw] system_instruction + # @return [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent] + # Content of the system instruction for the current API. + # + # These instructions will take priority over any other prompt instructions + # if the selected model is supporting them. + # @!attribute [rw] contents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent>] + # Content of the current conversation with the model. + # + # For single-turn queries, this is a single instance. For multi-turn queries, + # this is a repeated field that contains conversation history + latest + # request. + # @!attribute [rw] generation_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec] + # Content generation specification. + # @!attribute [rw] grounding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec] + # Grounding specification. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + class GenerateGroundedContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Content generation specification. + # @!attribute [rw] model_id + # @return [::String] + # Specifies which Vertex model id to use for generation. + # @!attribute [rw] language_code + # @return [::String] + # Language code for content. Use language tags defined by + # [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). + # @!attribute [rw] temperature + # @return [::Float] + # If specified, custom value for the temperature will be used. + # @!attribute [rw] top_p + # @return [::Float] + # If specified, custom value for nucleus sampling will be used. + # @!attribute [rw] top_k + # @return [::Integer] + # If specified, custom value for top-k sampling will be used. + # @!attribute [rw] frequency_penalty + # @return [::Float] + # If specified, custom value for frequency penalty will be used. + # @!attribute [rw] seed + # @return [::Integer] + # If specified, custom value for the seed will be used. + # @!attribute [rw] presence_penalty + # @return [::Float] + # If specified, custom value for presence penalty will be used. + # @!attribute [rw] max_output_tokens + # @return [::Integer] + # If specified, custom value for max output tokens will be used. + class GenerationSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the options to customize dynamic retrieval. + # @!attribute [rw] predictor + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor] + # Specification for the predictor for dynamic retrieval. + class DynamicRetrievalConfiguration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the predictor settings for dynamic retrieval. + # @!attribute [rw] version + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor::Version] + # The version of the predictor to be used in dynamic retrieval. + # @!attribute [rw] threshold + # @return [::Float] + # The value of the threshold. If the predictor will predict a + # value smaller than this, it would suppress grounding in the source. + class DynamicRetrievalPredictor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The version of the predictor to be used in dynamic retrieval. + module Version + # Automatically choose the best version of the retrieval predictor. + VERSION_UNSPECIFIED = 0 + + # The V1 model which is evaluating each source independently. + V1_INDEPENDENT = 1 + end + end + end + + # Grounding source. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::InlineSource] + # If set, grounding is performed with inline content. + # + # Note: The following fields are mutually exclusive: `inline_source`, `search_source`, `google_search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] search_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::SearchSource] + # If set, grounding is performed with Vertex AI Search. + # + # Note: The following fields are mutually exclusive: `search_source`, `inline_source`, `google_search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] google_search_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::GoogleSearchSource] + # If set, grounding is performed with Google Search. + # + # Note: The following fields are mutually exclusive: `google_search_source`, `inline_source`, `search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] enterprise_web_retrieval_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::EnterpriseWebRetrievalSource] + # If set, grounding is performed with enterprise web retrieval. + # + # Note: The following fields are mutually exclusive: `enterprise_web_retrieval_source`, `inline_source`, `search_source`, `google_search_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class GroundingSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message to be used for grounding based on inline content. + # @!attribute [rw] grounding_facts + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact>] + # List of facts to be used for grounding. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attributes associated with the content. + # + # Common attributes include `source` (indicating where the content was + # sourced from) and `author` (indicating the author of the content). + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message to be used for grounding with Vertex AI Search. + # @!attribute [rw] serving_config + # @return [::String] + # The resource name of the Engine to use. + # + # Format: + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + # @!attribute [rw] max_result_count + # @return [::Integer] + # Number of search results to return. + # + # The default value is 10. The maximumm allowed value is 10. + # @!attribute [rw] filter + # @return [::String] + # Filter expression to be applied to the search. + # + # The syntax is the same as + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @!attribute [rw] safe_search + # @return [::Boolean] + # If set, safe search is enabled in Vertex AI Search requests. + class SearchSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Google Search config parameters. + # @!attribute [rw] dynamic_retrieval_config + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration] + # Optional. Specifies the dynamic retrieval configuration for the given + # source. + class GoogleSearchSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Params for using enterprise web retrieval as grounding source. + class EnterpriseWebRetrievalSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Grounding specification. + # @!attribute [rw] grounding_sources + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource>] + # Grounding sources. + class GroundingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response for the `GenerateGroundedContent` method. + # @!attribute [rw] candidates + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate>] + # Generated candidates. + class GenerateGroundedContentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A response candidate generated from the model. + # @!attribute [rw] index + # @return [::Integer] + # Index of the candidate. + # @!attribute [rw] content + # @return [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent] + # Content of the candidate. + # @!attribute [rw] grounding_score + # @return [::Float] + # The overall grounding score for the candidate, in the range of [0, 1]. + # @!attribute [rw] grounding_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata] + # Grounding metadata for the generated content. + class Candidate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Citation for the generated content. + # @!attribute [rw] retrieval_metadata + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata>] + # Retrieval metadata to provide an understanding in the + # retrieval steps performed by the model. There can be multiple such + # messages which can correspond to different parts of the retrieval. This + # is a mechanism used to ensure transparency to our users. + # @!attribute [rw] support_chunks + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FactChunk>] + # List of chunks to be attributed across all claims in the candidate. + # These are derived from the grounding sources supplied in the request. + # @!attribute [rw] web_search_queries + # @return [::Array<::String>] + # Web search queries for the following-up web search. + # @!attribute [rw] search_entry_point + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::SearchEntryPoint] + # Google search entry for the following-up web searches. + # @!attribute [rw] grounding_support + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::GroundingSupport>] + # GroundingSupport across all claims in the answer candidate. + # An support to a fact indicates that the claim is supported by + # the fact. + # @!attribute [rw] images + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata>] + # Images from the web search. + class GroundingMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the metadata associated with a retrieval step. + # @!attribute [rw] source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata::Source] + # Describes the source to which the metadata is referring to. + # @!attribute [rw] dynamic_retrieval_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalMetadata] + # Metadata for dynamic retrieval. + class RetrievalMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the source to which the metadata is associated to. + module Source + # Unspecified source. + SOURCE_UNSPECIFIED = 0 + + # Vertex AI search. + VERTEX_AI_SEARCH = 1 + + # Google Search. + GOOGLE_SEARCH = 3 + + # User inline provided content. + INLINE_CONTENT = 2 + + # Google Maps. + GOOGLE_MAPS = 4 + end + end + + # Describes the metadata about dynamic retrieval. + # @!attribute [rw] predictor_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata] + # Metadata for the dynamic retrieval predictor. + class DynamicRetrievalMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the metadata about the dynamic retrieval predictor. + # @!attribute [rw] version + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata::Version] + # The version of the predictor which was used in dynamic retrieval. + # @!attribute [rw] prediction + # @return [::Float] + # The value of the predictor. This should be between [0, 1] where + # a value of 0 means that the query would not benefit from grounding, + # while a value of 1.0 means that the query would benefit the most. + # In between values allow to differentiate between different usefulness + # scores for grounding. + class DynamicRetrievalPredictorMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The version of the predictor which was used in dynamic retrieval. + module Version + # Unspecified version, should never be used. + VERSION_UNSPECIFIED = 0 + + # The V1 model which is evaluating each source independently. + V1_INDEPENDENT = 1 + end + end + + # Google search entry point. + # @!attribute [rw] rendered_content + # @return [::String] + # Web content snippet that can be embedded in a web page or an app + # webview. + # @!attribute [rw] sdk_blob + # @return [::String] + # Base64 encoded JSON representing array of + # tuple. + class SearchEntryPoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Grounding info for a claim in the candidate and its support. + # @!attribute [rw] claim_text + # @return [::String] + # Text for the claim in the candidate. Always provided when a + # support is found. + # @!attribute [rw] support_chunk_indices + # @return [::Array<::Integer>] + # A list of indices (into 'support_chunks') specifying the + # citations associated with the claim. For instance [1,3,4] means + # that support_chunks[1], support_chunks[3], + # support_chunks[4] are the chunks attributed to the claim. + # @!attribute [rw] support_score + # @return [::Float] + # A score in the range of [0, 1] describing how grounded is a specific + # claim in the support chunks indicated. + # Higher value means that the claim is better supported by the chunks. + class GroundingSupport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about an image from the web search. + # @!attribute [rw] image + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image] + # Metadata about the full size image. + # @!attribute [rw] thumbnail + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image] + # Metadata about the thumbnail. + # @!attribute [rw] source + # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::WebsiteInfo] + # The details about the website that the image is from. + class ImageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata about the website that the image is from. + # @!attribute [rw] uri + # @return [::String] + # The url of the website. + # @!attribute [rw] title + # @return [::String] + # The title of the website. + class WebsiteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about the image. + # @!attribute [rw] uri + # @return [::String] + # The url of the image. + # @!attribute [rw] width + # @return [::Integer] + # The width of the image in pixels. + # @!attribute [rw] height + # @return [::Integer] + # The height of the image in pixels. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + + # Specification for the grounding check. + # @!attribute [rw] citation_threshold + # @return [::Float] + # The threshold (in [0,1]) used for determining whether a fact must be + # cited for a claim in the answer candidate. Choosing a higher threshold + # will lead to fewer but very strong citations, while choosing a lower + # threshold may lead to more but somewhat weaker citations. If unset, the + # threshold will default to 0.6. + # @!attribute [rw] enable_claim_level_score + # @return [::Boolean] + # The control flag that enables claim-level grounding score in the response. + class CheckGroundingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding GroundedGenerationService.CheckGrounding} + # method. + # @!attribute [rw] grounding_config + # @return [::String] + # Required. The resource name of the grounding config, such as + # `projects/*/locations/global/groundingConfigs/default_grounding_config`. + # @!attribute [rw] answer_candidate + # @return [::String] + # Answer candidate to check. It can have a maximum length of 4096 tokens. + # @!attribute [rw] facts + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact>] + # List of facts for the grounding check. + # We support up to 200 facts. + # @!attribute [rw] grounding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec] + # Configuration of the grounding check. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + class CheckGroundingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for the + # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding GroundedGenerationService.CheckGrounding} + # method. + # @!attribute [rw] support_score + # @return [::Float] + # The support score for the input answer candidate. + # Higher the score, higher is the fraction of claims that are supported by + # the provided facts. This is always set when a response is returned. + # @!attribute [rw] cited_chunks + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FactChunk>] + # List of facts cited across all claims in the answer candidate. + # These are derived from the facts supplied in the request. + # @!attribute [rw] cited_facts + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::CheckGroundingFactChunk>] + # List of facts cited across all claims in the answer candidate. + # These are derived from the facts supplied in the request. + # @!attribute [rw] claims + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::Claim>] + # Claim texts and citation info across all claims in the answer candidate. + class CheckGroundingResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Fact chunk for grounding check. + # @!attribute [rw] chunk_text + # @return [::String] + # Text content of the fact chunk. Can be at most 10K characters long. + class CheckGroundingFactChunk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Text and citation info for a claim in the answer candidate. + # @!attribute [rw] start_pos + # @return [::Integer] + # Position indicating the start of the claim in the answer candidate, + # measured in bytes. Note that this is not measured in characters and, + # therefore, must be rendered in the user interface keeping in mind that + # some characters may take more than one byte. For example, + # if the claim text contains non-ASCII characters, the start and end + # positions vary when measured in characters + # (programming-language-dependent) and when measured in bytes + # (programming-language-independent). + # @!attribute [rw] end_pos + # @return [::Integer] + # Position indicating the end of the claim in the answer candidate, + # exclusive, in bytes. Note that this is not measured in characters and, + # therefore, must be rendered as such. For example, if the claim text + # contains non-ASCII characters, the start and end positions vary when + # measured in characters (programming-language-dependent) and when measured + # in bytes (programming-language-independent). + # @!attribute [rw] claim_text + # @return [::String] + # Text for the claim in the answer candidate. Always provided regardless of + # whether citations or anti-citations are found. + # @!attribute [rw] citation_indices + # @return [::Array<::Integer>] + # A list of indices (into 'cited_chunks') specifying the citations + # associated with the claim. For instance [1,3,4] means that + # cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited + # supporting for the claim. A citation to a fact indicates that the claim + # is supported by the fact. + # @!attribute [rw] grounding_check_required + # @return [::Boolean] + # Indicates that this claim required grounding check. When the system + # decided this claim doesn't require attribution/grounding check, this + # field will be set to false. In that case, no grounding check was done for + # the claim and therefore + # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::Claim#citation_indices citation_indices} + # should not be returned. + # @!attribute [rw] score + # @return [::Float] + # Confidence score for the claim in the answer candidate, in the range of + # [0, 1]. This is set only when + # `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true. + class Claim + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb new file mode 100644 index 000000000000..ee7063d2acb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Grounding Fact. + # @!attribute [rw] fact_text + # @return [::String] + # Text content of the fact. Can be at most 10K characters long. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::String}] + # Attributes associated with the fact. + # Common attributes include `source` (indicating where the fact was sourced + # from), `author` (indicating the author of the fact), and so on. + class GroundingFact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Fact Chunk. + # @!attribute [rw] chunk_text + # @return [::String] + # Text content of the fact chunk. Can be at most 10K characters long. + # @!attribute [rw] source + # @return [::String] + # Source from which this fact chunk was retrieved. If it was retrieved + # from the GroundingFacts provided in the request then this field will + # contain the index of the specific fact from which this chunk was + # retrieved. + # @!attribute [rw] index + # @return [::Integer] + # The index of this chunk. Currently, only used for the streaming mode. + # @!attribute [rw] source_metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # More fine-grained information for the source reference. + # @!attribute [rw] uri + # @return [::String] + # The URI of the source. + # @!attribute [rw] title + # @return [::String] + # The title of the source. + # @!attribute [rw] domain + # @return [::String] + # The domain of the source. + class FactChunk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class SourceMetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb new file mode 100644 index 000000000000..7e0dbe930da9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Identity Mapping Store which contains Identity Mapping Entries. + # @!attribute [rw] name + # @return [::String] + # Immutable. The full resource name of the identity mapping store. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}`. + # This field must be a UTF-8 encoded string with a length limit of 1024 + # characters. + # @!attribute [rw] kms_key_name + # @return [::String] + # Input only. The KMS key to be used to protect this Identity Mapping Store + # at creation time. + # + # Must be set for requests that need to comply with CMEK Org Policy + # protections. + # + # If this field is set and processed successfully, the Identity Mapping Store + # will be protected by the KMS key, as indicated in the cmek_config field. + # @!attribute [r] cmek_config + # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] + # Output only. CMEK-related information for the Identity Mapping Store. + class IdentityMappingStore + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identity Mapping Entry that maps an external identity to an internal + # identity. + # @!attribute [rw] user_id + # @return [::String] + # User identifier. + # For Google Workspace user account, user_id should be the google workspace + # user email. + # For non-google identity provider, user_id is the mapped user identifier + # configured during the workforcepool config. + # + # Note: The following fields are mutually exclusive: `user_id`, `group_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] group_id + # @return [::String] + # Group identifier. + # For Google Workspace user account, group_id should be the google + # workspace group email. + # For non-google identity provider, group_id is the mapped group identifier + # configured during the workforcepool config. + # + # Note: The following fields are mutually exclusive: `group_id`, `user_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] external_identity + # @return [::String] + # Required. Identity outside the customer identity provider. + # The length limit of external identity will be of 100 characters. + class IdentityMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb new file mode 100644 index 000000000000..532656e9fbf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb @@ -0,0 +1,279 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store IdentityMappingStoreService.CreateIdentityMappingStore} + # @!attribute [rw] cmek_config_name + # @return [::String] + # Resource name of the CmekConfig to use for protecting this Identity + # Mapping Store. + # + # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disable_cmek + # @return [::Boolean] + # Identity Mapping Store without CMEK protections. If a default CmekConfig + # is set for the project, setting this field will override the default + # CmekConfig as well. + # + # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent collection resource name, such as + # `projects/{project}/locations/{location}`. + # @!attribute [rw] identity_mapping_store_id + # @return [::String] + # Required. The ID of the Identity Mapping Store to create. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + # (_), and hyphens (-). The maximum length is 63 characters. + # @!attribute [rw] identity_mapping_store + # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] + # Required. The Identity Mapping Store to create. + class CreateIdentityMappingStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store IdentityMappingStoreService.GetIdentityMappingStore} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Identity Mapping Store to get. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + class GetIdentityMappingStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store IdentityMappingStoreService.DeleteIdentityMappingStore} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Identity Mapping Store to delete. + # Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + class DeleteIdentityMappingStoreRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource] + # The inline source to import identity mapping entries from. + # @!attribute [rw] identity_mapping_store + # @return [::String] + # Required. The name of the Identity Mapping Store to import Identity Mapping + # Entries to. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + class ImportIdentityMappingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source to import identity mapping entries from. + # @!attribute [rw] identity_mapping_entries + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # A maximum of 10000 entries can be imported at one time + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + class ImportIdentityMappingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings IdentityMappingStoreService.PurgeIdentityMappings} + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource] + # The inline source to purge identity mapping entries from. + # @!attribute [rw] identity_mapping_store + # @return [::String] + # Required. The name of the Identity Mapping Store to purge Identity Mapping + # Entries from. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @!attribute [rw] filter + # @return [::String] + # Filter matching identity mappings to purge. + # The eligible field for filtering is: + # * `update_time`: in ISO 8601 "zulu" format. + # * `external_id` + # + # Examples: + # + # * Deleting all identity mappings updated in a time range: + # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < + # "2012-04-23T18:30:43.511Z"` + # * Deleting all identity mappings for a given external_id: + # `external_id = "id1"` + # * Deleting all identity mappings inside an identity mapping store: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # Should not be used with source. An error will be thrown, if both are + # provided. + # @!attribute [rw] force + # @return [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any identity mappings. This field is + # only supported for purge with filter. For input source this field is + # ignored and data will be purged regardless of the value of this field. + class PurgeIdentityMappingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source to purge identity mapping entries from. + # @!attribute [rw] identity_mapping_entries + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # A maximum of 10000 entries can be purged at one time + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings IdentityMappingStoreService.ListIdentityMappings} + # @!attribute [rw] identity_mapping_store + # @return [::String] + # Required. The name of the Identity Mapping Store to list Identity Mapping + # Entries in. Format: + # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of IdentityMappings to return. If unspecified, defaults + # to 2000. The maximum allowed value is 10000. Values above 10000 will be + # coerced to 10000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListIdentityMappings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappings` must match the call that provided the page + # token. + class ListIdentityMappingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings IdentityMappingStoreService.ListIdentityMappings} + # @!attribute [rw] identity_mapping_entries + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] + # The Identity Mapping Entries. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. If this + # field is omitted, there are no subsequent pages. + class ListIdentityMappingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores IdentityMappingStoreService.ListIdentityMappingStores} + # @!attribute [rw] parent + # @return [::String] + # Required. The parent of the Identity Mapping Stores to list. + # Format: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of IdentityMappingStores to return. If unspecified, defaults + # to 100. The maximum allowed value is 1000. Values above 1000 will be + # coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListIdentityMappingStores` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListIdentityMappingStores` must match the call that provided the page + # token. + class ListIdentityMappingStoresRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores IdentityMappingStoreService.ListIdentityMappingStores} + # @!attribute [rw] identity_mapping_stores + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] + # The Identity Mapping Stores. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. If this + # field is omitted, there are no subsequent pages. + class ListIdentityMappingStoresResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # IdentityMappingEntry LongRunningOperation metadata for + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} + # and + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings IdentityMappingStoreService.PurgeIdentityMappings} + # @!attribute [rw] success_count + # @return [::Integer] + # The number of IdentityMappingEntries that were successfully processed. + # @!attribute [rw] failure_count + # @return [::Integer] + # The number of IdentityMappingEntries that failed to be processed. + # @!attribute [rw] total_count + # @return [::Integer] + # The total number of IdentityMappingEntries that were processed. + class IdentityMappingEntryOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store IdentityMappingStoreService.DeleteIdentityMappingStore} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteIdentityMappingStoreMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb new file mode 100644 index 000000000000..2031993a5973 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb @@ -0,0 +1,867 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Cloud Storage location for input content. + # @!attribute [rw] input_uris + # @return [::Array<::String>] + # Required. Cloud Storage URIs to input files. Each 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`). + # @!attribute [rw] data_schema + # @return [::String] + # The schema to use when parsing the data from the source. + # + # Supported values for document imports: + # + # * `document` (default): One JSON + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} per line. Each + # document must + # have a valid {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the + # data store. This can only be used by the GENERIC Data Store vertical. + # * `csv`: A CSV file with header conforming to the defined + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the + # data store. Each entry after the header is imported as a Document. + # This can only be used by the GENERIC Data Store vertical. + # + # Supported values for user event imports: + # + # * `user_event` (default): One JSON + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} per line. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BigQuery source import data from. + # @!attribute [rw] partition_date + # @return [::Google::Type::Date] + # BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. + # @!attribute [rw] project_id + # @return [::String] + # The project ID or the project number that contains the BigQuery source. Has + # a length limit of 128 characters. If not specified, inherits the project + # ID from the parent request. + # @!attribute [rw] dataset_id + # @return [::String] + # Required. The BigQuery data set to copy the data from with a length limit + # of 1,024 characters. + # @!attribute [rw] table_id + # @return [::String] + # Required. The BigQuery table to copy the data from with a length limit of + # 1,024 characters. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # 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. + # @!attribute [rw] data_schema + # @return [::String] + # The schema to use when parsing the data from the source. + # + # Supported values for user event imports: + # + # * `user_event` (default): One + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} per row. + # + # Supported values for document imports: + # + # * `document` (default): One + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} format per + # row. Each document must have a valid + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} and one of + # {::Google::Cloud::DiscoveryEngine::V1::Document#json_data Document.json_data} + # or + # {::Google::Cloud::DiscoveryEngine::V1::Document#struct_data Document.struct_data}. + # * `custom`: One custom data per row in arbitrary format that conforms to + # the defined {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the data + # store. This can only be used by the GENERIC Data Store vertical. + class BigQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Spanner source for importing data + # @!attribute [rw] project_id + # @return [::String] + # The project ID that contains the Spanner source. Has a length limit of 128 + # characters. If not specified, inherits the project ID from the parent + # request. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The instance ID of the source Spanner table. + # @!attribute [rw] database_id + # @return [::String] + # Required. The database ID of the source Spanner table. + # @!attribute [rw] table_id + # @return [::String] + # Required. The table name of the Spanner database that needs to be imported. + # @!attribute [rw] enable_data_boost + # @return [::Boolean] + # Whether to apply data boost on Spanner export. Enabling this option will + # incur additional cost. More info can be found + # [here](https://cloud.google.com/spanner/docs/databoost/databoost-overview#billing_and_quotas). + class SpannerSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Bigtable Options object that contains information to support + # the import. + # @!attribute [rw] key_field_name + # @return [::String] + # The field name used for saving row key value in the document. The name has + # to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. + # @!attribute [rw] families + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumnFamily}] + # The mapping from family names to an object that contains column families + # level information for the given column family. If a family is not present + # in this map it will be ignored. + class BigtableOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The column family of the Bigtable. + # @!attribute [rw] field_name + # @return [::String] + # The field name to use for this column family in the document. The + # name has to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. If not set, + # it is parsed from the family name with best effort. However, due to + # different naming patterns, field name collisions could happen, where + # parsing behavior is undefined. + # @!attribute [rw] encoding + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Encoding] + # The encoding mode of the values when the type is not STRING. + # Acceptable encoding values are: + # + # * `TEXT`: indicates values are alphanumeric text strings. + # * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` + # family of functions. This can be overridden for a specific column + # by listing that column in `columns` and specifying an encoding for it. + # @!attribute [rw] type + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Type] + # The type of values in this column family. + # The values are expected to be encoded using `HBase Bytes.toBytes` + # function when the encoding value is set to `BINARY`. + # @!attribute [rw] columns + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumn>] + # The list of objects that contains column level information for each + # column. If a column is not present in this list it will be ignored. + class BigtableColumnFamily + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The column of the Bigtable. + # @!attribute [rw] qualifier + # @return [::String] + # Required. Qualifier of the column. If it cannot be decoded with utf-8, + # use a base-64 encoded string instead. + # @!attribute [rw] field_name + # @return [::String] + # The field name to use for this column in the document. The name has to + # match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. + # If not set, it is parsed from the qualifier bytes with best effort. + # However, due to different naming patterns, field name collisions could + # happen, where parsing behavior is undefined. + # @!attribute [rw] encoding + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Encoding] + # The encoding mode of the values when the type is not `STRING`. + # Acceptable encoding values are: + # + # * `TEXT`: indicates values are alphanumeric text strings. + # * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` + # family of functions. This can be overridden for a specific column + # by listing that column in `columns` and specifying an encoding for it. + # @!attribute [rw] type + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Type] + # The type of values in this column family. + # The values are expected to be encoded using `HBase Bytes.toBytes` + # function when the encoding value is set to `BINARY`. + class BigtableColumn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumnFamily] + class FamiliesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of values in a Bigtable column or column family. + # The values are expected to be encoded using + # [HBase + # Bytes.toBytes](https://hbase.apache.org/1.4/apidocs/org/apache/hadoop/hbase/util/Bytes.html) + # function when the encoding value is set to `BINARY`. + module Type + # The type is unspecified. + TYPE_UNSPECIFIED = 0 + + # String type. + STRING = 1 + + # Numerical type. + NUMBER = 2 + + # Integer type. + INTEGER = 3 + + # Variable length integer type. + VAR_INTEGER = 4 + + # BigDecimal type. + BIG_NUMERIC = 5 + + # Boolean type. + BOOLEAN = 6 + + # JSON type. + JSON = 7 + end + + # The encoding mode of a Bigtable column or column family. + module Encoding + # The encoding is unspecified. + ENCODING_UNSPECIFIED = 0 + + # Text encoding. + TEXT = 1 + + # Binary encoding. + BINARY = 2 + end + end + + # The Cloud Bigtable source for importing data. + # @!attribute [rw] project_id + # @return [::String] + # The project ID that contains the Bigtable source. Has a length limit of 128 + # characters. If not specified, inherits the project ID from the parent + # request. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The instance ID of the Cloud Bigtable that needs to be imported. + # @!attribute [rw] table_id + # @return [::String] + # Required. The table ID of the Cloud Bigtable that needs to be imported. + # @!attribute [rw] bigtable_options + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions] + # Required. Bigtable options that contains information needed when parsing + # data into typed structures. For example, column type annotations. + class BigtableSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud FhirStore source import data from. + # @!attribute [rw] fhir_store + # @return [::String] + # Required. The full resource name of the FHIR store to import data from, in + # the format of + # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}`. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # 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 + # FhirStore export to a specific Cloud Storage directory. + # @!attribute [rw] resource_types + # @return [::Array<::String>] + # The FHIR resource types to import. The resource types should be a subset of + # all [supported FHIR resource + # types](https://cloud.google.com/generative-ai-app-builder/docs/fhir-schema-reference#resource-level-specification). + # Default to all supported FHIR resource types if empty. + # @!attribute [rw] update_from_latest_predefined_schema + # @return [::Boolean] + # Optional. Whether to update the DataStore schema to the latest predefined + # schema. + # + # If true, the DataStore schema will be updated to include any FHIR fields + # or resource types that have been added since the last import and + # corresponding FHIR resources will be imported from the FHIR store. + # + # Note this field cannot be used in conjunction with `resource_types`. It + # should be used after initial import. + class FhirStoreSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud SQL source import data from. + # @!attribute [rw] project_id + # @return [::String] + # The project ID that contains the Cloud SQL source. Has a length limit of + # 128 characters. If not specified, inherits the project ID from the parent + # request. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The Cloud SQL instance to copy the data from with a length limit + # of 256 characters. + # @!attribute [rw] database_id + # @return [::String] + # Required. The Cloud SQL database to copy the data from with a length limit + # of 256 characters. + # @!attribute [rw] table_id + # @return [::String] + # Required. The Cloud SQL table to copy the data from with a length limit of + # 256 characters. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # 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 + # Cloud SQL export to a specific Cloud Storage directory. + # + # Ensure that the Cloud SQL service account has the necessary Cloud + # Storage Admin permissions to access the specified Cloud Storage directory. + # @!attribute [rw] offload + # @return [::Boolean] + # Option for serverless export. Enabling this option will incur additional + # cost. More info can be found + # [here](https://cloud.google.com/sql/pricing#serverless). + class CloudSqlSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AlloyDB source import data from. + # @!attribute [rw] project_id + # @return [::String] + # The project ID that contains the AlloyDB source. + # Has a length limit of 128 characters. If not specified, inherits the + # project ID from the parent request. + # @!attribute [rw] location_id + # @return [::String] + # Required. The AlloyDB location to copy the data from with a length limit of + # 256 characters. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The AlloyDB cluster to copy the data from with a length limit of + # 256 characters. + # @!attribute [rw] database_id + # @return [::String] + # Required. The AlloyDB database to copy the data from with a length limit of + # 256 characters. + # @!attribute [rw] table_id + # @return [::String] + # Required. The AlloyDB table to copy the data from with a length limit of + # 256 characters. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # 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 + # AlloyDB export to a specific Cloud Storage directory. + # + # Ensure that the AlloyDB service account has the necessary Cloud + # Storage Admin permissions to access the specified Cloud Storage directory. + class AlloyDbSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Firestore source import data from. + # @!attribute [rw] project_id + # @return [::String] + # The project ID that the Cloud SQL source is in with a length limit of 128 + # characters. If not specified, inherits the project ID from the parent + # request. + # @!attribute [rw] database_id + # @return [::String] + # Required. The Firestore database to copy the data from with a length limit + # of 256 characters. + # @!attribute [rw] collection_id + # @return [::String] + # Required. The Firestore collection (or entity) to copy the data from with a + # length limit of 1,500 characters. + # @!attribute [rw] gcs_staging_dir + # @return [::String] + # 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 + # Firestore export to a specific Cloud Storage directory. + # + # Ensure that the Firestore service account has the necessary Cloud + # Storage Admin permissions to access the specified Cloud Storage directory. + class FirestoreSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of destination for Import related errors. + # @!attribute [rw] gcs_prefix + # @return [::String] + # 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. + class ImportErrorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the ImportUserEvents request. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource] + # The Inline source for the input content for UserEvents. + # + # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] + # Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] + # BigQuery input source. + # + # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent DataStore resource name, of the form + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # The desired location of errors incurred during the Import. Cannot be set + # for inline user event imports. + class ImportUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for the input config for ImportUserEvents method. + # @!attribute [rw] user_events + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserEvent>] + # Required. A list of user events to import. Recommended max of 10k items. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # 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. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # Echoes the destination for the complete errors if this field was set in + # the request. + # @!attribute [rw] joined_events_count + # @return [::Integer] + # Count of user events imported with complete existing Documents. + # @!attribute [rw] unjoined_events_count + # @return [::Integer] + # Count of user events imported, but with Document information not found + # in the existing Branch. + class ImportUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the Import operation. This is + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were processed successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + class ImportUserEventsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the ImportDocuments operation. This is + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were processed successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + # @!attribute [rw] total_count + # @return [::Integer] + # Total count of entries that were processed. + class ImportDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for Import methods. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource] + # The Inline source for the input content for documents. + # + # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] + # Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] + # BigQuery input source. + # + # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] fhir_store_source + # @return [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource] + # FhirStore input source. + # + # Note: The following fields are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] spanner_source + # @return [::Google::Cloud::DiscoveryEngine::V1::SpannerSource] + # Spanner input source. + # + # Note: The following fields are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] cloud_sql_source + # @return [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource] + # Cloud SQL input source. + # + # Note: The following fields are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] firestore_source + # @return [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource] + # Firestore input source. + # + # Note: The following fields are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] alloy_db_source + # @return [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource] + # AlloyDB input source. + # + # Note: The following fields are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bigtable_source + # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableSource] + # Cloud Bigtable input source. + # + # Note: The following fields are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent branch resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # Requires create/update permission. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # The desired location of errors incurred during the Import. + # @!attribute [rw] reconciliation_mode + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] + # The mode of reconciliation between existing documents and the documents to + # be imported. Defaults to + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided imported documents to update. If + # not set, the default is to update all fields. + # @!attribute [rw] auto_generate_ids + # @return [::Boolean] + # Whether to automatically generate IDs for the documents if absent. + # + # If set to `true`, + # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} + # is highly recommended to avoid duplicate contents. If unset or set to + # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have + # to be specified using + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, + # otherwise, documents without IDs fail to be imported. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @!attribute [rw] id_field + # @return [::String] + # The field indicates the ID field or column to be used as unique IDs of + # the documents. + # + # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of + # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. + # For others, it may be the column name of the table where the unique ids are + # stored. + # + # The values of the JSON field or the table column are used as the + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field + # or the table 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 + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. + # + # Supported data sources: + # + # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. + # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. + # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} + # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. + # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. + # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. + # @!attribute [rw] force_refresh_content + # @return [::Boolean] + # Optional. Whether to force refresh the unstructured content of the + # documents. + # + # If set to `true`, the content part of the documents will be refreshed + # regardless of the update status of the referencing content. + class ImportDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for the input config for ImportDocuments method. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document>] + # Required. A list of documents to update/create. Each document must have a + # valid {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}. + # Recommended max of 100 items. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Indicates how imported documents are reconciled with the existing documents + # created or imported before. + module 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 + end + end + + # Response of the + # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest 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. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # Echoes the destination for the complete errors in the request if set. + class ImportDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries CompletionService.ImportSuggestionDenyListEntries} + # method. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource] + # The Inline source for the input content for suggestion deny list entries. + # + # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] + # Cloud Storage location for the input content. + # + # Only 1 file can be specified that contains all entries to import. + # Supported values `gcs_source.schema` for autocomplete suggestion deny + # list entry imports: + # + # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] + # per line. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + class ImportSuggestionDenyListEntriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for SuggestionDenyListEntry. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry>] + # Required. A list of all denylist entries to import. Max of 1000 items. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries CompletionService.ImportSuggestionDenyListEntries} + # method. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] imported_entries_count + # @return [::Integer] + # Count of deny list entries successfully imported. + # @!attribute [rw] failed_entries_count + # @return [::Integer] + # Count of deny list entries that failed to be imported. + class ImportSuggestionDenyListEntriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the ImportSuggestionDenyListEntries + # operation. This is returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class ImportSuggestionDenyListEntriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions CompletionService.ImportCompletionSuggestions} + # method. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource] + # The Inline source for suggestion entries. + # + # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] + # Cloud Storage location for the input content. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bigquery_source + # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] + # BigQuery input source. + # + # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name for which to import customer + # autocomplete suggestions. + # + # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # The desired location of errors incurred during the Import. + class ImportCompletionSuggestionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for CompletionSuggestions. + # @!attribute [rw] suggestions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion>] + # Required. A list of all denylist entries to import. Max of 1000 items. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response of the + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions CompletionService.ImportCompletionSuggestions} + # method. If the long running operation is done, this message is returned by + # the google.longrunning.Operations.response field if the operation is + # successful. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # The desired location of errors incurred during the Import. + class ImportCompletionSuggestionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the ImportCompletionSuggestions + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # successfully imported. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of + # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s + # that failed to be imported. + class ImportCompletionSuggestionsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb new file mode 100644 index 000000000000..21030dace2a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Metadata and configurations for a Google Cloud project in the service. + # @!attribute [r] name + # @return [::String] + # Output only. Full resource name of the project, for example + # `projects/{project}`. + # Note that when making requests, project number and project id are both + # acceptable, but the server will always respond in project number. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this project is created. + # @!attribute [r] provision_completion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this project is successfully provisioned. + # Empty value means this project is still provisioning and is not ready for + # use. + # @!attribute [r] service_terms_map + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms}] + # Output only. A map of terms of services. The key is the `id` of + # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms ServiceTerms}. + class Project + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata about the terms of service. + # @!attribute [rw] id + # @return [::String] + # The unique identifier of this terms of service. + # Available terms: + # + # * `GA_DATA_USE_TERMS`: [Terms for data + # use](https://cloud.google.com/retail/data-use-terms). When using this as + # `id`, the acceptable + # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms#version version} + # to provide is `2022-11-23`. + # @!attribute [rw] version + # @return [::String] + # The version string of the terms of service. + # For acceptable values, see the comments for + # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms#id id} above. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms::State] + # Whether the project has accepted/rejected the service terms or it is + # still pending. + # @!attribute [rw] accept_time + # @return [::Google::Protobuf::Timestamp] + # The last time when the project agreed to the terms of service. + # @!attribute [rw] decline_time + # @return [::Google::Protobuf::Timestamp] + # The last time when the project declined or revoked the agreement to terms + # of service. + class ServiceTerms + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The agreement states this terms of service. + module State + # The default value of the enum. This value is not actually used. + STATE_UNSPECIFIED = 0 + + # The project has given consent to the terms of service. + TERMS_ACCEPTED = 1 + + # The project is pending to review and accept the terms of service. + TERMS_PENDING = 2 + + # The project has declined or revoked the agreement to terms of service. + TERMS_DECLINED = 3 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms] + class ServiceTermsMapEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb new file mode 100644 index 000000000000..a7e5c844df1b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request for + # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project ProjectService.ProvisionProject} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as + # `projects/{project_id_or_number}`. + # @!attribute [rw] accept_data_use_terms + # @return [::Boolean] + # Required. Set to `true` to specify that caller has read and would like to + # give consent to the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms). + # @!attribute [rw] data_use_terms_version + # @return [::String] + # Required. The version of the [Terms for data + # use](https://cloud.google.com/retail/data-use-terms) that caller has read + # and would like to give consent to. + # + # Acceptable version is `2022-11-23`, and this may change over time. + class ProvisionProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata associated with a project provision operation. + class ProvisionProjectMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb new file mode 100644 index 000000000000..63bffde4f59e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb @@ -0,0 +1,293 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for PurgeUserEvents method. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the catalog under which the events are + # created. The format is + # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. + # @!attribute [rw] filter + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. + # + # Note: This API only supports purging a max range of 30 days. + # + # Examples: + # + # * Deleting all events in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z"` + # * Deleting specific eventType in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` + # * Deleting all events for a specific visitor in a time range: + # `eventTime > "2012-04-23T18:25:43.511Z" + # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` + # * Deleting the past 30 days of events inside a DataStore: + # `*` + # + # The filtering fields are assumed to have an implicit AND. + # @!attribute [rw] force + # @return [::Boolean] + # 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. + class PurgeUserEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of the PurgeUserEventsRequest. If the long running operation is + # successfully done, then this message is returned by the + # google.longrunning.Operations.response field. + # @!attribute [rw] purge_count + # @return [::Integer] + # The total count of events purged as a result of the operation. + class PurgeUserEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeUserEvents operation. + # This will be returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were deleted successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + class PurgeUserEventsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of destination for Purge related errors. + # @!attribute [rw] gcs_prefix + # @return [::String] + # Cloud Storage prefix for purge errors. This must be an empty, + # existing Cloud Storage directory. Purge errors are written to + # sharded files in this directory, one per line, as a JSON-encoded + # `google.rpc.Status` message. + class PurgeErrorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} + # method. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] + # Cloud Storage location for the input content. + # Supported `data_schema`: + # * `document_id`: One valid + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource] + # Inline source for the input content for purge. + # + # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. + # @!attribute [rw] filter + # @return [::String] + # Required. Filter matching documents to purge. Only currently supported + # value is + # `*` (all items). + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig] + # The desired location of errors incurred during the purge. + # @!attribute [rw] force + # @return [::Boolean] + # Actually performs the purge. If `force` is set to false, return the + # expected purge count without deleting any documents. + class PurgeDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for the input config for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} + # method. + # @!attribute [rw] documents + # @return [::Array<::String>] + # Required. A list of full resource name of documents to purge. In the + # format + # `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. + # Recommended max of 100 items. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} + # method. If the long running operation is successfully done, then this message + # is returned by the google.longrunning.Operations.response field. + # @!attribute [rw] purge_count + # @return [::Integer] + # The total count of documents purged as a result of the operation. + # @!attribute [rw] purge_sample + # @return [::Array<::String>] + # 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. + class PurgeDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeDocuments operation. + # This will be returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of entries that were deleted successfully. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of entries that encountered errors while processing. + # @!attribute [rw] ignored_count + # @return [::Integer] + # Count of entries that were ignored as entries were not found. + class PurgeDocumentsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries CompletionService.PurgeSuggestionDenyListEntries} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name for which to import denylist + # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. + class PurgeSuggestionDenyListEntriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries CompletionService.PurgeSuggestionDenyListEntries} + # method. + # @!attribute [rw] purge_count + # @return [::Integer] + # Number of suggestion deny list entries purged. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + class PurgeSuggestionDenyListEntriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeSuggestionDenyListEntries + # operation. This is returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class PurgeSuggestionDenyListEntriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions CompletionService.PurgeCompletionSuggestions} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name for which to purge completion + # suggestions. Follows pattern + # projects/*/locations/*/collections/*/dataStores/*. + class PurgeCompletionSuggestionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions CompletionService.PurgeCompletionSuggestions} + # method. + # @!attribute [rw] purge_succeeded + # @return [::Boolean] + # Whether the completion suggestions were successfully purged. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + class PurgeCompletionSuggestionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the PurgeCompletionSuggestions + # operation. This is returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class PurgeCompletionSuggestionsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb new file mode 100644 index 000000000000..c3812f5907f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Record message for + # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. + # @!attribute [rw] id + # @return [::String] + # The unique ID to represent the record. + # @!attribute [rw] title + # @return [::String] + # The title of the record. Empty by default. + # At least one of + # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#title title} or + # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#content content} should be + # set otherwise an INVALID_ARGUMENT error is thrown. + # @!attribute [rw] content + # @return [::String] + # The content of the record. Empty by default. + # At least one of + # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#title title} or + # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#content content} should be + # set otherwise an INVALID_ARGUMENT error is thrown. + # @!attribute [rw] score + # @return [::Float] + # The score of this record based on the given query and selected model. + # The score will be rounded to 2 decimal places. If the score is close to 0, + # it will be rounded to 0.0001 to avoid returning unset. + class RankingRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. + # @!attribute [rw] ranking_config + # @return [::String] + # Required. The resource name of the rank service config, such as + # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. + # @!attribute [rw] model + # @return [::String] + # The identifier of the model to use. It is one of: + # + # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input + # token size 512. + # + # It is set to `semantic-ranker-512@latest` by default if unspecified. + # @!attribute [rw] top_n + # @return [::Integer] + # The number of results to return. If this is unset or no bigger than zero, + # returns all results. + # @!attribute [rw] query + # @return [::String] + # The query to use. + # @!attribute [rw] records + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord>] + # Required. A list of records to rank. At most 200 records to rank. + # @!attribute [rw] ignore_record_details_in_response + # @return [::Boolean] + # If true, the response will contain only record ID and score. By default, it + # is false, the response will contain record details. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + class RankRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. + # @!attribute [rw] records + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord>] + # A list of records sorted by descending score. + class RankResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb new file mode 100644 index 000000000000..9b19adfd8a30 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb @@ -0,0 +1,230 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for Recommend method. + # @!attribute [rw] serving_config + # @return [::String] + # Required. Full resource name of a + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: + # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or + # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` + # + # One default serving config is created along with your recommendation engine + # creation. The engine ID is used as the ID of the default serving + # config. For example, for Engine + # `projects/*/locations/global/collections/*/engines/my-engine`, you can use + # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` + # for your + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend} + # requests. + # @!attribute [rw] user_event + # @return [::Google::Cloud::DiscoveryEngine::V1::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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # or + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # to a random unique ID and leave + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} + # unset. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of results to return. Set this property + # to the number of recommendation results needed. If zero, the service + # chooses a reasonable default. The maximum allowed value is 100. Values + # above 100 are set to 100. + # @!attribute [rw] filter + # @return [::String] + # 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: + # + # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) + # * (available: true) AND + # (language: ANY("en", "es")) OR (categories: ANY("Movie")) + # + # If your filter blocks all results, the API returns generic + # (unfiltered) popular Documents. If you only want results strictly matching + # the filters, set `strictFiltering` to `true` in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} + # to receive empty results instead. + # + # Note that the API never returns + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` + # as `EXPIRED` or `DELETED` regardless of filter choices. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Use validate only mode for this recommendation query. If set to `true`, a + # fake model is 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. + # @!attribute [rw] params + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional domain specific parameters for the recommendations. + # + # Allowed values: + # + # * `returnDocument`: Boolean. If set to `true`, the associated Document + # object is returned in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. + # * `returnScore`: Boolean. If set to true, the recommendation score + # corresponding to each returned Document is set in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 + # returns 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. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + class RecommendRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ParamsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for Recommend method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult>] + # A list of recommended Documents. The order represents the ranking (from the + # most relevant Document to the least). + # @!attribute [rw] attribution_token + # @return [::String] + # A unique attribution token. This should be included in the + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from + # this recommendation, which enables accurate attribution of recommendation + # model performance. + # @!attribute [rw] missing_ids + # @return [::Array<::String>] + # IDs of documents in the request that were missing from the default Branch + # associated with the requested ServingConfig. + # @!attribute [rw] validate_only + # @return [::Boolean] + # True if + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#validate_only RecommendRequest.validate_only} + # was set. + class RecommendResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # RecommendationResult represents a generic recommendation result with + # associated metadata. + # @!attribute [rw] id + # @return [::String] + # Resource ID of the recommended Document. + # @!attribute [rw] document + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # Set if `returnDocument` is set to true in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params}. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Additional Document metadata or annotations. + # + # Possible values: + # + # * `score`: Recommendation score in double value. Is set if + # `returnScore` is set to true in + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params}. + class RecommendationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb new file mode 100644 index 000000000000..7744d0519170 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Safety rating corresponding to the generated content. + # @!attribute [r] category + # @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory] + # Output only. Harm category. + # @!attribute [r] probability + # @return [::Google::Cloud::DiscoveryEngine::V1::SafetyRating::HarmProbability] + # Output only. Harm probability levels in the content. + # @!attribute [r] probability_score + # @return [::Float] + # Output only. Harm probability score. + # @!attribute [r] severity + # @return [::Google::Cloud::DiscoveryEngine::V1::SafetyRating::HarmSeverity] + # Output only. Harm severity levels in the content. + # @!attribute [r] severity_score + # @return [::Float] + # Output only. Harm severity score. + # @!attribute [r] blocked + # @return [::Boolean] + # Output only. Indicates whether the content was filtered out because of this + # rating. + class SafetyRating + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Harm probability levels in the content. + module HarmProbability + # Harm probability unspecified. + HARM_PROBABILITY_UNSPECIFIED = 0 + + # Negligible level of harm. + NEGLIGIBLE = 1 + + # Low level of harm. + LOW = 2 + + # Medium level of harm. + MEDIUM = 3 + + # High level of harm. + HIGH = 4 + end + + # Harm severity levels. + module HarmSeverity + # Harm severity unspecified. + HARM_SEVERITY_UNSPECIFIED = 0 + + # Negligible level of harm severity. + HARM_SEVERITY_NEGLIGIBLE = 1 + + # Low level of harm severity. + HARM_SEVERITY_LOW = 2 + + # Medium level of harm severity. + HARM_SEVERITY_MEDIUM = 3 + + # High level of harm severity. + HARM_SEVERITY_HIGH = 4 + end + end + + # Harm categories that will block the content. + module HarmCategory + # The harm category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0 + + # The harm category is hate speech. + HARM_CATEGORY_HATE_SPEECH = 1 + + # The harm category is dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 2 + + # The harm category is harassment. + HARM_CATEGORY_HARASSMENT = 3 + + # The harm category is sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 + + # The harm category is civic integrity. + HARM_CATEGORY_CIVIC_INTEGRITY = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb new file mode 100644 index 000000000000..dbf9c28816ec --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Defines the structure and layout of a type of document data. + # @!attribute [rw] struct_schema + # @return [::Google::Protobuf::Struct] + # The structured representation of the schema. + # + # Note: The following fields are mutually exclusive: `struct_schema`, `json_schema`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] json_schema + # @return [::String] + # The JSON representation of the schema. + # + # Note: The following fields are mutually exclusive: `json_schema`, `struct_schema`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # 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. + class Schema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb new file mode 100644 index 000000000000..c5b05e63a03d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb @@ -0,0 +1,177 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema SchemaService.GetSchema} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + class GetSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to + # return. The service may return fewer than this value. + # + # If unspecified, at most 100 + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. + # + # The maximum value is 1000; values above 1000 are set to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # must match the call that provided the page token. + class ListSchemasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} + # method. + # @!attribute [rw] schemas + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Schema>] + # The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest#page_token ListSchemasRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + class ListSchemasResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema SchemaService.CreateSchema} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent data store resource name, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # @!attribute [rw] schema + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. + # @!attribute [rw] schema_id + # @return [::String] + # Required. The ID to use for the + # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final + # component of the + # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. + # + # This field should conform to + # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length + # limit of 63 characters. + class CreateSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema SchemaService.UpdateSchema} + # method. + # @!attribute [rw] schema + # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is + # created. In this situation, `update_mask` is ignored. + class UpdateSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema SchemaService.DeleteSchema} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the schema, in the format of + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. + class DeleteSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for Create Schema LRO. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class CreateSchemaMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for UpdateSchema LRO. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class UpdateSchemaMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for DeleteSchema LRO. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteSchemaMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb new file mode 100644 index 000000000000..8c03501e65d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb @@ -0,0 +1,1946 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # method. + # @!attribute [rw] serving_config + # @return [::String] + # Required. The resource name of the Search serving config, such as + # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, + # or + # `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. + # @!attribute [rw] branch + # @return [::String] + # 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. + # @!attribute [rw] query + # @return [::String] + # Raw search query. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` + # @!attribute [rw] image_query + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery] + # Raw image query. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to + # return. The maximum allowed value depends on the data type. Values above + # the maximum value are coerced to the maximum value. + # + # * Websites with basic indexing: Default `10`, Maximum `25`. + # * Websites with advanced indexing: Default `25`, Maximum `50`. + # * Other: Default `50`, Maximum `100`. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token received from a previous + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # must match the call that provided the page token. Otherwise, an + # `INVALID_ARGUMENT` error is returned. + # @!attribute [rw] offset + # @return [::Integer] + # A 0-indexed integer that specifies the current offset (that is, starting + # result location, amongst the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as + # relevant) in search results. This field is only considered if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is + # unset. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. + # @!attribute [rw] one_box_page_size + # @return [::Integer] + # The maximum number of results to return for OneBox. + # This applies to each OneBox type individually. + # Default number is 10. + # @!attribute [rw] data_store_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] + # Specifications that define the specific + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, + # along with configurations for those data stores. This is only considered + # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data + # stores. For engines with a single data store, the specs directly under + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be + # used. + # @!attribute [rw] filter + # @return [::String] + # 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. + # + # Filtering in Vertex AI Search is done by mapping the LHS filter key to a + # key property defined in the Vertex AI Search backend -- this mapping is + # defined by the customer in their schema. For example a media customer might + # have a field 'name' in their schema. In this case the filter would look + # like this: filter --> name:'ANY("king kong")' + # + # For more information about filtering including syntax and filter + # operators, see + # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @!attribute [rw] canonical_filter + # @return [::String] + # The default filter that is applied when a user performs a search without + # checking any filters on the search page. + # + # The filter applied to every search request when quality improvement such as + # query expansion is needed. In the case a query does not have a sufficient + # amount of results this filter will be used to determine whether or not to + # enable the query expansion flow. The original filter will still be used for + # the query expanded search. + # This field is strongly recommended to achieve high search quality. + # + # For more information about filter syntax, see + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. + # @!attribute [rw] order_by + # @return [::String] + # The order in which documents are returned. Documents can be ordered by + # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. + # Leave it unset if ordered by relevance. `order_by` expression is + # case-sensitive. + # + # For more information on ordering the website search results, see + # [Order web search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). + # For more information on ordering the healthcare search results, see + # [Order healthcare search + # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). + # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. + # @!attribute [rw] user_info + # @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo] + # Information about the end user. + # Highly recommended for analytics and personalization. + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} + # is used to deduce `device_type` for analytics. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see [Standard + # fields](https://cloud.google.com/apis/design/standard_fields). This field + # helps to better interpret the query. If a value isn't specified, the query + # language code is automatically detected, which may not be accurate. + # @!attribute [rw] facet_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec>] + # 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. + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] + # Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @!attribute [rw] params + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # 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. + # For example, `user_country_code: "au"` + # + # For available codes see [Country + # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) + # + # * `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. + # For example, `search_type: 1` + # @!attribute [rw] query_expansion_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec] + # The query expansion specification that specifies the conditions under which + # query expansion occurs. + # @!attribute [rw] spell_correction_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec] + # The spell correction specification that specifies the mode under + # which spell correction takes effect. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # Optional. 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # and + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. + # @!attribute [rw] content_search_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec] + # A specification for configuring the behavior of content search. + # @!attribute [rw] ranking_expression + # @return [::String] + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. + # The syntax and supported features depend on the + # `ranking_expression_backend` value. If `ranking_expression_backend` is not + # provided, it defaults to `RANK_BY_EMBEDDING`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single + # function or multiple functions that are joined 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)`. + # + # If + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} + # is set to `RANK_BY_FORMULA`, the following expression types (and + # combinations of those chained using + or + # * operators) are supported: + # + # * `double` + # * `signal` + # * `log(signal)` + # * `exp(signal)` + # * `rr(signal, double > 0)` -- reciprocal rank transformation with second + # argument being a denominator constant. + # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. + # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns + # signal2 | double, else returns signal1. + # + # Here are a few examples of ranking formulas that use the supported + # ranking expression types: + # + # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` + # -- mostly rank by the logarithm of `keyword_similarity_score` with slight + # `semantic_smilarity_score` adjustment. + # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * + # is_nan(keyword_similarity_score)` -- rank by the exponent of + # `semantic_similarity_score` filling the value with 0 if it's NaN, also + # add constant 0.3 adjustment to the final score if + # `semantic_similarity_score` is NaN. + # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * + # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank + # of `keyword_similarity_score` with slight adjustment of reciprocal rank + # of `semantic_smilarity_score`. + # + # The following signals are supported: + # + # * `semantic_similarity_score`: semantic similarity adjustment that is + # calculated using the embeddings generated by a proprietary Google model. + # This score determines how semantically similar a search query is to a + # document. + # * `keyword_similarity_score`: keyword match adjustment uses the Best + # Match 25 (BM25) ranking function. This score is calculated using a + # probabilistic model to estimate the probability that a document is + # relevant to a given query. + # * `relevance_score`: semantic relevance adjustment that uses a + # proprietary Google model to determine the meaning and intent behind a + # user's query in context with the content in the documents. + # * `pctr_rank`: predicted conversion rate adjustment as a rank use + # predicted Click-through rate (pCTR) to gauge the relevance and + # attractiveness of a search result from a user's perspective. A higher + # pCTR suggests that the result is more likely to satisfy the user's query + # and intent, making it a valuable signal for ranking. + # * `freshness_rank`: freshness adjustment as a rank + # * `document_age`: The time in hours elapsed since the document was last + # updated, a floating-point number (e.g., 0.25 means 15 minutes). + # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary + # Google model to determine the keyword-based overlap between the query and + # the document. + # * `base_rank`: the default rank of the result + # @!attribute [rw] ranking_expression_backend + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] + # Optional. The backend to use for the ranking expression evaluation. + # @!attribute [rw] safe_search + # @return [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + # @!attribute [rw] natural_language_query_understanding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @!attribute [rw] search_as_you_type_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @!attribute [rw] display_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec] + # Optional. Config for display feature, like match highlighting on search + # results. + # @!attribute [rw] crowding_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @!attribute [rw] session + # @return [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @!attribute [rw] session_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec] + # Session specification. + # + # Can be used only when `session` is set. + # @!attribute [rw] relevance_threshold + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @!attribute [rw] relevance_score_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec] + # Optional. The specification for returning the relevance score. + class SearchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the image query input. + # @!attribute [rw] image_bytes + # @return [::String] + # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and + # BMP. + class ImageQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A struct to define data stores to filter on in a search call and + # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` + # error is returned. + # @!attribute [rw] data_store + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # The path must include the project number, project id is not supported for + # this field. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter specification to filter documents in the data store + # specified by data_store field. For more information on filtering, see + # [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) + # @!attribute [rw] boost_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] + # Optional. Boost specification to boost certain documents. + # For more information on boosting, see + # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) + # @!attribute [rw] custom_search_operators + # @return [::String] + # Optional. Custom search operators which if specified will be used to + # filter results from workspace data stores. For more information on custom + # search operators, see + # [SearchOperators](https://support.google.com/cloudsearch/answer/6172299). + class DataStoreSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A facet specification to perform faceted search. + # @!attribute [rw] facet_key + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey] + # Required. The facet key specification. + # @!attribute [rw] limit + # @return [::Integer] + # Maximum facet values that are returned for this facet. If + # unspecified, defaults to 20. The maximum allowed value is 300. Values + # above 300 are coerced to 300. + # For aggregation in healthcare search, when the [FacetKey.key] is + # "healthcare_aggregation_key", the limit will be overridden to + # 10,000 internally, regardless of the value set here. + # + # If this field is negative, an `INVALID_ARGUMENT` is returned. + # @!attribute [rw] excluded_filter_keys + # @return [::Array<::String>] + # List of keys to exclude when faceting. + # + # By default, + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key 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 + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key 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. + # @!attribute [rw] enable_dynamic_position + # @return [::Boolean] + # 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. + class FacetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how a facet is computed. + # @!attribute [rw] key + # @return [::String] + # Required. Supported textual and numerical facet keys in + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object, over which + # the facet values are computed. Facet key is case-sensitive. + # @!attribute [rw] intervals + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Interval>] + # 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. + # @!attribute [rw] restricted_values + # @return [::Array<::String>] + # 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. + # @!attribute [rw] prefixes + # @return [::Array<::String>] + # 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. + # @!attribute [rw] contains + # @return [::Array<::String>] + # Only get facet values that contain 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. + # @!attribute [rw] case_insensitive + # @return [::Boolean] + # True to make facet keys case insensitive when getting faceting + # values with prefixes or contains; false otherwise. + # @!attribute [rw] order_by + # @return [::String] + # The order in which documents are returned. + # + # Allowed values are: + # + # * "count desc", which means order by + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} + # descending. + # + # * "value desc", which means order by + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.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 + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}. + class FacetKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Boost specification to boost certain documents. + # @!attribute [rw] condition_boost_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec>] + # Condition boost specifications. If a document matches multiple conditions + # in the specifications, boost scores from these specifications are all + # applied and combined in a non-linear way. Maximum number of + # specifications is 20. + class BoostSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Boost applies to documents which match a condition. + # @!attribute [rw] condition + # @return [::String] + # An expression which specifies a boost condition. The syntax and + # supported fields are the same as a filter expression. See + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter} + # for detail syntax and limitations. + # + # Examples: + # + # * To boost documents with document ID "doc_1" or "doc_2", and + # color "Red" or "Blue": + # `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))` + # @!attribute [rw] boost + # @return [::Float] + # 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. Only one of the (condition, boost) combination or the + # boost_control_spec below are set. If both are set then the global boost + # is ignored and the more fine-grained boost_control_spec is applied. + # @!attribute [rw] boost_control_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec] + # Complex specification for custom ranking based on customer defined + # attribute value. + class ConditionBoostSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification for custom ranking based on customer specified attribute + # value. It provides more controls for customized ranking than the simple + # (condition, boost) combination above. + # @!attribute [rw] field_name + # @return [::String] + # The name of the field whose value will be used to determine the + # boost amount. + # @!attribute [rw] attribute_type + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType] + # The attribute type to be used to determine the boost amount. The + # attribute value can be derived from the field value of the specified + # field_name. In the case of numerical it is straightforward i.e. + # attribute_value = numerical_field_value. In the case of freshness + # however, attribute_value = (time.now() - datetime_field_value). + # @!attribute [rw] interpolation_type + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType] + # The interpolation type to be applied to connect the control points + # listed below. + # @!attribute [rw] control_points + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>] + # The control points used to define the curve. The monotonic function + # (defined through the interpolation_type above) passes through the + # control points listed here. + class BoostControlSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The control points used to define the curve. The curve defined + # through these control points can only be monotonically increasing + # or decreasing(constant values are acceptable). + # @!attribute [rw] attribute_value + # @return [::String] + # Can be one of: + # 1. The numerical field value. + # 2. The duration spec for freshness: + # The value must be formatted as an XSD `dayTimeDuration` value (a + # restricted subset of an ISO 8601 duration value). The pattern for + # this is: `[nD][T[nH][nM][nS]]`. + # @!attribute [rw] boost_amount + # @return [::Float] + # The value between -1 to 1 by which to boost the score if the + # attribute_value evaluates to the value specified above. + class ControlPoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The attribute(or function) for which the custom ranking is to be + # applied. + module AttributeType + # Unspecified AttributeType. + ATTRIBUTE_TYPE_UNSPECIFIED = 0 + + # The value of the numerical field will be used to dynamically update + # the boost amount. In this case, the attribute_value (the x value) + # of the control point will be the actual value of the numerical + # field for which the boost_amount is specified. + NUMERICAL = 1 + + # For the freshness use case the attribute value will be the duration + # between the current time and the date in the datetime field + # specified. The value must be formatted as an XSD `dayTimeDuration` + # value (a restricted subset of an ISO 8601 duration value). The + # pattern for this is: `[nD][T[nH][nM][nS]]`. + # For example, `5D`, `3DT12H30M`, `T24H`. + FRESHNESS = 2 + end + + # The interpolation type to be applied. Default will be linear + # (Piecewise Linear). + module InterpolationType + # Interpolation type is unspecified. In this case, it defaults to + # Linear. + INTERPOLATION_TYPE_UNSPECIFIED = 0 + + # Piecewise linear interpolation will be applied. + LINEAR = 1 + end + end + end + end + + # Specification to determine under which conditions query expansion should + # occur. + # @!attribute [rw] condition + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition] + # The condition under which query expansion should occur. Default to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. + # @!attribute [rw] pin_unexpanded_results + # @return [::Boolean] + # 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. + class QueryExpansionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition query expansion should occur. + module Condition + # Unspecified query expansion condition. In this case, server behavior + # defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. + CONDITION_UNSPECIFIED = 0 + + # Disabled query expansion. Only the exact search query is used, even if + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size SearchResponse.total_size} + # is zero. + DISABLED = 1 + + # Automatic query expansion built by the Search API. + AUTO = 2 + end + end + + # The specification for query spell correction. + # @!attribute [rw] mode + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode] + # The mode under which spell correction + # replaces the original search query. Defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. + class SpellCorrectionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which mode spell correction should occur. + module Mode + # Unspecified spell correction mode. In this case, server behavior + # defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. + MODE_UNSPECIFIED = 0 + + # Search API tries to find a spelling suggestion. If a suggestion is + # found, it is put in the + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#corrected_query SearchResponse.corrected_query}. + # The spelling suggestion won't 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 + end + end + + # A specification for configuring the behavior of content search. + # @!attribute [rw] snippet_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SnippetSpec] + # If `snippetSpec` is not specified, snippets are not included in the + # search response. + # @!attribute [rw] summary_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec] + # If `summarySpec` is not specified, summaries are not included in the + # search response. + # @!attribute [rw] extractive_content_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ExtractiveContentSpec] + # If there is no extractive_content_spec provided, there will be no + # extractive answer in the search response. + # @!attribute [rw] search_result_mode + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode] + # Specifies the search result mode. If unspecified, the + # search result mode defaults to `DOCUMENTS`. + # @!attribute [rw] chunk_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec] + # Specifies the chunk spec to be returned from the search response. + # Only available if the + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS} + class ContentSearchSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A specification for configuring snippets in a search response. + # @!attribute [rw] max_snippet_count + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # [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. + # @!attribute [rw] reference_only + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # [DEPRECATED] This field is deprecated and will have no affect on the + # snippet. + # @!attribute [rw] return_snippet + # @return [::Boolean] + # 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. + class SnippetSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A specification for configuring a summary returned in a search + # response. + # @!attribute [rw] summary_result_count + # @return [::Integer] + # 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 10 results for documents mode, or 50 for chunks mode, can be + # used to generate a summary. The chunks mode is used when + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}. + # @!attribute [rw] include_citations + # @return [::Boolean] + # 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. + # @!attribute [rw] ignore_adversarial_query + # @return [::Boolean] + # 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. + # @!attribute [rw] ignore_non_summary_seeking_query + # @return [::Boolean] + # 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. + # @!attribute [rw] ignore_low_relevant_content + # @return [::Boolean] + # Specifies whether to filter out queries that have low relevance. The + # default value is `false`. + # + # If this field is set to `false`, all search results are used regardless + # of relevance to generate answers. If set to `true`, only queries with + # high relevance search results will generate answers. + # @!attribute [rw] ignore_jail_breaking_query + # @return [::Boolean] + # Optional. Specifies whether to filter out jail-breaking queries. The + # default value is `false`. + # + # Google employs search-query classification to detect jail-breaking + # queries. No summary is returned if the search query is classified as a + # jail-breaking query. A user might add instructions to the query to + # change the tone, style, language, content of the answer, or ask the + # model to act as a different entity, e.g. "Reply in the tone of a + # competing company's CEO". If this field is set to `true`, we skip + # generating summaries for jail-breaking queries and return fallback + # messages instead. + # @!attribute [rw] model_prompt_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec] + # If specified, the spec will be used to modify the prompt provided to + # the LLM. + # @!attribute [rw] language_code + # @return [::String] + # 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. + # @!attribute [rw] model_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec] + # If specified, the spec will be used to modify the model specification + # provided to the LLM. + # @!attribute [rw] use_semantic_chunks + # @return [::Boolean] + # If true, answer will be generated from most relevant chunks from top + # search results. This feature will improve summary quality. + # Note that with this feature enabled, not all top search results + # will be referenced and included in the reference list, so the citation + # source index only points to the search results listed in the reference + # list. + class SummarySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specification of the prompt to use with the model. + # @!attribute [rw] preamble + # @return [::String] + # Text at the beginning of the prompt that instructs the assistant. + # Examples are available in the user guide. + class ModelPromptSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of the model. + # @!attribute [rw] version + # @return [::String] + # The model version used to generate the summary. + # + # Supported values are: + # + # * `stable`: string. Default value when no value is specified. Uses a + # generally available, fine-tuned model. For more information, see + # [Answer generation model versions and + # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). + # * `preview`: string. (Public preview) Uses a preview model. For more + # information, see + # [Answer generation model versions and + # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). + class ModelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A specification for configuring the extractive content in a search + # response. + # @!attribute [rw] max_extractive_answer_count + # @return [::Integer] + # 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 five answers are returned for each + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult SearchResult}. + # @!attribute [rw] max_extractive_segment_count + # @return [::Integer] + # The max number of extractive segments returned in each search result. + # Only applied if the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is set to + # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED} + # or + # {::Google::Cloud::DiscoveryEngine::V1::DataStore#solution_types DataStore.solution_types} + # is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT 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`. + # @!attribute [rw] return_extractive_segment_score + # @return [::Boolean] + # Specifies whether to return the confidence score from the extractive + # segments in each search result. This feature is available only for new + # or allowlisted data stores. To allowlist your data store, + # contact your Customer Engineer. The default value is `false`. + # @!attribute [rw] num_previous_segments + # @return [::Integer] + # Specifies whether to also include the adjacent from each selected + # segments. + # Return at most `num_previous_segments` segments before each selected + # segments. + # @!attribute [rw] num_next_segments + # @return [::Integer] + # Return at most `num_next_segments` segments after each selected + # segments. + class ExtractiveContentSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the chunk spec to be returned from the search response. + # Only available if the + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS} + # @!attribute [rw] num_previous_chunks + # @return [::Integer] + # The number of previous chunks to be returned of the current chunk. The + # maximum allowed value is 3. + # If not specified, no previous chunks will be returned. + # @!attribute [rw] num_next_chunks + # @return [::Integer] + # The number of next chunks to be returned of the current chunk. The + # maximum allowed value is 3. + # If not specified, no next chunks will be returned. + class ChunkSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the search result mode. If unspecified, the + # search result mode defaults to `DOCUMENTS`. + module SearchResultMode + # Default value. + SEARCH_RESULT_MODE_UNSPECIFIED = 0 + + # Returns documents in the search result. + DOCUMENTS = 1 + + # Returns chunks in the search result. Only available if the + # {::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config} + # is specified. + CHUNKS = 2 + end + end + + # Specification to enable natural language understanding capabilities for + # search requests. + # @!attribute [rw] filter_extraction_condition + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition] + # The condition under which filter extraction should occur. + # Server behavior defaults to `DISABLED`. + # @!attribute [rw] geo_search_query_detection_field_names + # @return [::Array<::String>] + # Field names used for location-based filtering, where geolocation filters + # are detected in natural language search queries. + # Only valid when the FilterExtractionCondition is set to `ENABLED`. + # + # If this field is set, it overrides the field names set in + # [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1.ServingConfig.geo_search_query_detection_field_names]. + # @!attribute [rw] extracted_filter_behavior + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior] + # Optional. Controls behavior of how extracted filters are applied to the + # search. The default behavior depends on the request. For single datastore + # structured search, the default is `HARD_FILTER`. For multi-datastore + # search, the default behavior is `SOFT_BOOST`. + # Location-based filters are always applied as hard filters, and the + # `SOFT_BOOST` setting will not affect them. + # This field is only used if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}. + # @!attribute [rw] allowed_field_names + # @return [::Array<::String>] + # Optional. Allowlist of fields that can be used for natural language + # filter extraction. By default, if this is unspecified, all indexable + # fields are eligible for natural language filter extraction (but are not + # guaranteed to be used). If any fields are specified in + # allowed_field_names, only the fields that are both marked as indexable in + # the schema and specified in the allowlist will be eligible for natural + # language filter extraction. Note: for multi-datastore search, this is not + # yet supported, and will be ignored. + class NaturalLanguageQueryUnderstandingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition filter extraction should occur. + module FilterExtractionCondition + # Server behavior defaults to `DISABLED`. + CONDITION_UNSPECIFIED = 0 + + # Disables NL filter extraction. + DISABLED = 1 + + # Enables NL filter extraction. + ENABLED = 2 + end + + # Enum describing how extracted filters are applied to the search. + module ExtractedFilterBehavior + # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior + # for extracted filters. For single datastore search, the default is to + # apply as hard filters. For multi-datastore search, the default is to + # apply as soft boosts. + EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0 + + # Applies all extracted filters as hard filters on the results. Results + # that do not pass the extracted filters will not be returned in the + # result set. + HARD_FILTER = 1 + + # Applies all extracted filters as soft boosts. Results that pass the + # filters will be boosted up to higher ranks in the result set. + SOFT_BOOST = 2 + end + end + + # Specification for search as you type in search requests. + # @!attribute [rw] condition + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition] + # The condition under which search as you type should occur. + # Default to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}. + class SearchAsYouTypeSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition search as you type should occur. + module Condition + # Server behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}. + CONDITION_UNSPECIFIED = 0 + + # Disables Search As You Type. + DISABLED = 1 + + # Enables Search As You Type. + ENABLED = 2 + + # Automatic switching between search-as-you-type and standard search + # modes, ideal for single-API implementations (e.g., debouncing). + AUTO = 3 + end + end + + # Specifies features for display, like match highlighting. + # @!attribute [rw] match_highlighting_condition + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec::MatchHighlightingCondition] + # The condition under which match highlighting should occur. + class DisplaySpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition match highlighting should occur. + module MatchHighlightingCondition + # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`. + MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0 + + # Disables match highlighting on all documents. + MATCH_HIGHLIGHTING_DISABLED = 1 + + # Enables match highlighting on all documents. + MATCH_HIGHLIGHTING_ENABLED = 2 + end + end + + # Specification for crowding. Crowding improves the diversity of search + # results by limiting the number of results that share the same field value. + # For example, crowding on the color field with a max_count of 3 and mode + # DROP_CROWDED_RESULTS will return at most 3 results with the same color + # across all pages. + # @!attribute [rw] field + # @return [::String] + # The field to use for crowding. Documents can be crowded by a field in the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. Crowding + # field is case sensitive. + # @!attribute [rw] max_count + # @return [::Integer] + # The maximum number of documents to keep per value of the field. Once + # there are at least max_count previous results which contain the same + # value for the given field (according to the order specified in + # `order_by`), later results with the same value are "crowded away". + # If not specified, the default value is 1. + # @!attribute [rw] mode + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode] + # Mode to use for documents that are crowded away. + class CrowdingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing the mode to use for documents that are crowded away. + # They can be dropped or demoted to the later pages. + module Mode + # Unspecified crowding mode. In this case, server behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}. + MODE_UNSPECIFIED = 0 + + # Drop crowded results. + DROP_CROWDED_RESULTS = 1 + + # Demote crowded results to the later pages. + DEMOTE_CROWDED_RESULTS_TO_END = 2 + end + end + + # Session specification. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @!attribute [rw] query_id + # @return [::String] + # If set, the search result gets stored to the "turn" specified by this + # query ID. + # + # Example: Let's say the session looks like this: + # session { + # name: ".../sessions/xxx" + # turns { + # query { text: "What is foo?" query_id: ".../questions/yyy" } + # answer: "Foo is ..." + # } + # turns { + # query { text: "How about bar then?" query_id: ".../questions/zzz" } + # } + # } + # + # The user can call /search API with a request like this: + # + # session: ".../sessions/xxx" + # session_spec { query_id: ".../questions/zzz" } + # + # Then, the API stores the search result, associated with the last turn. + # The stored search result can be used by a subsequent /answer API call + # (with the session ID and the query ID specified). Also, it is possible + # to call /search and /answer in parallel with the same session ID & query + # ID. + # @!attribute [rw] search_result_persistence_count + # @return [::Integer] + # The number of top search results to persist. The persisted search results + # can be used for the subsequent /answer api call. + # + # This field is similar to the `summary_result_count` field in + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}. + # + # At most 10 results for documents mode, or 50 for chunks mode. + class SessionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The specification for returning the document relevance score. + # @!attribute [rw] return_relevance_score + # @return [::Boolean] + # Optional. Whether to return the relevance score for search results. + # The higher the score, the more relevant the document is to the query. + class RelevanceScoreSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class ParamsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The backend to use for the ranking expression evaluation. + module RankingExpressionBackend + # Default option for unspecified/unknown values. + RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0 + + # Deprecated: Use `RANK_BY_EMBEDDING` instead. + # Ranking by custom embedding model, the default way to evaluate the + # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be + # used instead. + BYOE = 1 + + # Deprecated: Use `RANK_BY_FORMULA` instead. + # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should + # be used instead. + CLEARBOX = 2 + + # Ranking by custom embedding model, the default way to evaluate the + # ranking expression. + RANK_BY_EMBEDDING = 3 + + # Ranking by custom formula. + RANK_BY_FORMULA = 4 + end + + # The relevance threshold of the search results. The higher relevance + # threshold is, the higher relevant results are shown and the less number of + # results are returned. + module RelevanceThreshold + # Default value. In this case, server behavior defaults to Google defined + # threshold. + RELEVANCE_THRESHOLD_UNSPECIFIED = 0 + + # Lowest relevance threshold. + LOWEST = 1 + + # Low relevance threshold. + LOW = 2 + + # Medium relevance threshold. + MEDIUM = 3 + + # High relevance threshold. + HIGH = 4 + end + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # method. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] + # A list of matched documents. The order represents the ranking. + # @!attribute [rw] facets + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet>] + # Results of facets requested by user. + # @!attribute [rw] total_size + # @return [::Integer] + # The estimated total count of matched items irrespective of pagination. The + # count of {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#results results} + # returned by pagination may be less than the + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size total_size} + # that matches. + # @!attribute [rw] attribution_token + # @return [::String] + # A unique search token. This should be included in the + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from + # this search, which enables accurate attribution of search model + # performance. This also helps to identify a request during the customer + # support scenarios. + # @!attribute [rw] redirect_uri + # @return [::String] + # The URI of a customer-defined redirect page. If redirect action is + # triggered, no search is performed, and only + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#redirect_uri redirect_uri} + # and + # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token attribution_token} + # are set in the response. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token SearchRequest.page_token} + # to retrieve the next page. If this field is omitted, there are no + # subsequent pages. + # @!attribute [rw] corrected_query + # @return [::String] + # 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. + # @!attribute [rw] summary + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary] + # A summary as part of the search results. + # This field is only returned if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#summary_spec SearchRequest.ContentSearchSpec.summary_spec} + # is set. + # @!attribute [rw] query_expansion_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo] + # Query expansion information for the returned results. + # @!attribute [r] natural_language_query_understanding_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo] + # Output only. Natural language query understanding information for the + # returned results. + # @!attribute [rw] session_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo] + # Session information. + # + # Only set if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session} + # is provided. See its description for more details. + # @!attribute [rw] search_link_promotions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion>] + # Promotions for site search. + # @!attribute [r] semantic_state + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SemanticState] + # Output only. Indicates the semantic state of the search response. + class SearchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the search results. + # @!attribute [rw] id + # @return [::String] + # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the + # searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}. + # @!attribute [rw] document + # @return [::Google::Cloud::DiscoveryEngine::V1::Document] + # The document data snippet in the search response. Only fields that are + # marked as `retrievable` are populated. + # @!attribute [rw] chunk + # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk] + # The chunk data in the search response if the + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}. + # @!attribute [r] model_scores + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}] + # Output only. Google provided available scores. + # @!attribute [rw] rank_signals + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals] + # Optional. A set of ranking signals associated with the result. + class SearchResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of ranking signals. + # @!attribute [rw] keyword_similarity_score + # @return [::Float] + # Optional. Keyword matching adjustment. + # @!attribute [rw] relevance_score + # @return [::Float] + # Optional. Semantic relevance adjustment. + # @!attribute [rw] semantic_similarity_score + # @return [::Float] + # Optional. Semantic similarity adjustment. + # @!attribute [rw] pctr_rank + # @return [::Float] + # Optional. Predicted conversion rate adjustment as a rank. + # @!attribute [rw] topicality_rank + # @return [::Float] + # Optional. Topicality adjustment as a rank. + # @!attribute [rw] document_age + # @return [::Float] + # Optional. Age of the document in hours. + # @!attribute [rw] boosting_factor + # @return [::Float] + # Optional. Combined custom boosts for a doc. + # @!attribute [rw] default_rank + # @return [::Float] + # Optional. The default rank of the result. + # @!attribute [rw] custom_signals + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>] + # Optional. A list of custom clearbox signals. + class RankSignals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Custom clearbox signal represented by name and value pair. + # @!attribute [rw] name + # @return [::String] + # Optional. Name of the signal. + # @!attribute [rw] value + # @return [::Float] + # Optional. Float value representing the ranking signal (e.g. 1.25 for + # BM25). + class CustomSignal + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList] + class ModelScoresEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A facet result. + # @!attribute [rw] key + # @return [::String] + # The key for this facet. For example, `"colors"` or `"price"`. It matches + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>] + # The facet values for this field. + # @!attribute [rw] dynamic_facet + # @return [::Boolean] + # Whether the facet is dynamically generated. + class Facet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A facet value which contains value names and their count. + # @!attribute [rw] value + # @return [::String] + # Text value of a facet, such as "Black" for facet "colors". + # + # Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] interval + # @return [::Google::Cloud::DiscoveryEngine::V1::Interval] + # Interval value for a facet, such as [10, 20) for facet "price". It + # matches + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}. + # + # Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] count + # @return [::Integer] + # Number of items that have this facet value. + class FacetValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Summary of the top N search results specified by the summary spec. + # @!attribute [rw] summary_text + # @return [::String] + # The summary content. + # @!attribute [rw] summary_skipped_reasons + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>] + # Additional summary-skipped reasons. This provides the reason for ignored + # cases. If nothing is skipped, this field is not set. + # @!attribute [rw] safety_attributes + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes] + # A collection of Safety Attribute categories and their associated + # confidence scores. + # @!attribute [rw] summary_with_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata] + # Summary with metadata information. + class Summary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Safety Attribute categories and their associated confidence scores. + # @!attribute [rw] categories + # @return [::Array<::String>] + # The display names of Safety Attribute categories associated with the + # generated content. Order matches the Scores. + # @!attribute [rw] scores + # @return [::Array<::Float>] + # The confidence scores of the each category, higher + # value means higher confidence. Order matches the Categories. + class SafetyAttributes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Citation metadata. + # @!attribute [rw] citations + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>] + # Citations for segments. + class CitationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Citation info for a segment. + # @!attribute [rw] start_index + # @return [::Integer] + # Index indicates the start of the segment, measured in bytes/unicode. + # @!attribute [rw] end_index + # @return [::Integer] + # End of the attributed segment, exclusive. + # @!attribute [rw] sources + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>] + # Citation sources for the attributed segment. + class Citation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Citation source. + # @!attribute [rw] reference_index + # @return [::Integer] + # Document reference index from SummaryWithMetadata.references. + # It is 0-indexed and the value will be zero if the reference_index is + # not set explicitly. + class CitationSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Document reference. + # @!attribute [rw] title + # @return [::String] + # Title of the document. + # @!attribute [rw] document + # @return [::String] + # Required. + # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the + # document. Full resource name of the referenced document, in the format + # `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. + # @!attribute [rw] uri + # @return [::String] + # Cloud Storage or HTTP uri for the document. + # @!attribute [rw] chunk_contents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>] + # List of cited chunk contents derived from document content. + class Reference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Chunk content. + # @!attribute [rw] content + # @return [::String] + # Chunk textual content. + # @!attribute [rw] page_identifier + # @return [::String] + # Page identifier. + class ChunkContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Summary with metadata information. + # @!attribute [rw] summary + # @return [::String] + # Summary text with no citation information. + # @!attribute [rw] citation_metadata + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata] + # Citation metadata for given summary. + # @!attribute [rw] references + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>] + # Document References. + class SummaryWithMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Enum for summary-skipped reasons. + module SummarySkippedReason + # Default value. The summary skipped reason is not specified. + SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0 + + # The adversarial query ignored case. + # + # Only used when + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query} + # is set to `true`. + ADVERSARIAL_QUERY_IGNORED = 1 + + # The non-summary seeking query ignored case. + # + # Google skips the summary if the query is chit chat. + # Only used when + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query 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 no relevant content case. + # + # Google skips the summary if there is no relevant content in the + # retrieved search results. + NO_RELEVANT_CONTENT = 6 + + # The jail-breaking query ignored case. + # + # For example, "Reply in the tone of a competing company's CEO". + # Only used when + # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query] + # is set to `true`. + JAIL_BREAKING_QUERY_IGNORED = 7 + + # The customer policy violation case. + # + # Google skips the summary if there is a customer policy violation + # detected. The policy is defined by the customer. + CUSTOMER_POLICY_VIOLATION = 8 + + # The non-answer seeking query ignored case. + # + # Google skips the summary if the query doesn't have clear intent. + # Only used when + # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query] + # is set to `true`. + NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9 + + # The time out case. + # + # Google skips the summary if the time out. + TIME_OUT = 10 + end + end + + # Information describing query expansion including whether expansion has + # occurred. + # @!attribute [rw] expanded_query + # @return [::Boolean] + # Bool describing whether query expansion has occurred. + # @!attribute [rw] pinned_result_count + # @return [::Integer] + # Number of pinned results. This field will only be set when expansion + # happens and + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results} + # is set to true. + class QueryExpansionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information describing what natural language understanding was + # done on the input query. + # @!attribute [rw] extracted_filters + # @return [::String] + # The filters that were extracted from the input query. + # @!attribute [rw] rewritten_query + # @return [::String] + # Rewritten input query minus the extracted filters. + # @!attribute [rw] classified_intents + # @return [::Array<::String>] + # The classified intents from the input query. + # @!attribute [rw] structured_extracted_filter + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter] + # The filters that were extracted from the input query represented in a + # structured form. + class NaturalLanguageQueryUnderstandingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The filters that were extracted from the input query represented in a + # structured form. + # @!attribute [rw] expression + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression] + # The expression denoting the filter that was extracted from the input + # query in a structured form. It can be a simple expression denoting a + # single string, numerical or geolocation constraint or a compound + # expression which is a combination of multiple expressions connected + # using logical (OR and AND) operators. + class StructuredExtractedFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Constraint expression of a string field. + # @!attribute [rw] field_name + # @return [::String] + # Name of the string field as defined in the schema. + # @!attribute [rw] values + # @return [::Array<::String>] + # Values of the string field. The record will only be returned if the + # field value matches one of the values specified here. + # @!attribute [rw] query_segment + # @return [::String] + # Identifies the keywords within the search query that match a filter. + class StringConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Constraint expression of a number field. Example: price < 100. + # @!attribute [rw] field_name + # @return [::String] + # Name of the numerical field as defined in the schema. + # @!attribute [rw] comparison + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison] + # The comparison operation performed between the field value and the + # value specified in the constraint. + # @!attribute [rw] value + # @return [::Float] + # The value specified in the numerical constraint. + # @!attribute [rw] query_segment + # @return [::String] + # Identifies the keywords within the search query that match a filter. + class NumberConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The comparison operation that was performed. + module Comparison + # Undefined comparison operator. + COMPARISON_UNSPECIFIED = 0 + + # Denotes equality `=` operator. + EQUALS = 1 + + # Denotes less than or equal to `<=` operator. + LESS_THAN_EQUALS = 2 + + # Denotes less than `<` operator. + LESS_THAN = 3 + + # Denotes greater than or equal to `>=` operator. + GREATER_THAN_EQUALS = 4 + + # Denotes greater than `>` operator. + GREATER_THAN = 5 + end + end + + # Constraint of a geolocation field. + # Name of the geolocation field as defined in the schema. + # @!attribute [rw] field_name + # @return [::String] + # The name of the geolocation field as defined in the schema. + # @!attribute [rw] address + # @return [::String] + # The reference address that was inferred from the input query. The + # proximity of the reference address to the geolocation field will be + # used to filter the results. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude of the geolocation inferred from the input query. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude of the geolocation inferred from the input query. + # @!attribute [rw] radius_in_meters + # @return [::Float] + # The radius in meters around the address. The record is returned if + # the location of the geolocation field is within the radius. + class GeolocationConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical `And` operator. + # @!attribute [rw] expressions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] + # The expressions that were ANDed together. + class AndExpression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical `Or` operator. + # @!attribute [rw] expressions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] + # The expressions that were ORed together. + class OrExpression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The expression denoting the filter that was extracted from the input + # query. + # @!attribute [rw] string_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint] + # String constraint expression. + # + # Note: The following fields are mutually exclusive: `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint] + # Numerical constraint expression. + # + # Note: The following fields are mutually exclusive: `number_constraint`, `string_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] geolocation_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint] + # Geolocation constraint expression. + # + # Note: The following fields are mutually exclusive: `geolocation_constraint`, `string_constraint`, `number_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] and_expr + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression] + # Logical "And" compound operator connecting multiple expressions. + # + # Note: The following fields are mutually exclusive: `and_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] or_expr + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression] + # Logical "Or" compound operator connecting multiple expressions. + # + # Note: The following fields are mutually exclusive: `or_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Expression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Information about the session. + # @!attribute [rw] name + # @return [::String] + # Name of the session. + # If the auto-session mode is used (when + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session} + # ends with "-"), this field holds the newly generated session name. + # @!attribute [rw] query_id + # @return [::String] + # Query ID that corresponds to this search API call. + # One session can have multiple turns, each with a unique query ID. + # + # By specifying the session name and this query ID in the Answer API call, + # the answer generation happens in the context of the search results from + # this search call. + class SessionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Semantic state of the search response. + module SemanticState + # Default value. Should not be used. + SEMANTIC_STATE_UNSPECIFIED = 0 + + # Semantic search was disabled for this search response. + DISABLED = 1 + + # Semantic search was enabled for this search response. + ENABLED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb new file mode 100644 index 000000000000..434617ba702a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models SearchTuningService.ListCustomModels} + # method. + # @!attribute [rw] data_store + # @return [::String] + # Required. The resource name of the parent Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to fetch the models + # from. + class ListCustomModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models SearchTuningService.ListCustomModels} + # method. + # @!attribute [rw] models + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CustomTuningModel>] + # List of custom tuning models. + class ListCustomModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model SearchTuningService.TrainCustomModel} + # method. + # @!attribute [rw] gcs_training_input + # @return [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput] + # Cloud Storage training input. + # @!attribute [rw] data_store + # @return [::String] + # Required. The resource name of the Data Store, such as + # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. + # This field is used to identify the data store where to train the models. + # @!attribute [rw] model_type + # @return [::String] + # Model to be trained. Supported values are: + # + # * **search-tuning**: Fine tuning the search system based on data provided. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # The desired location of errors incurred during the data ingestion and + # training. + # @!attribute [rw] model_id + # @return [::String] + # If not provided, a UUID will be generated. + class TrainCustomModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Cloud Storage training data input. + # @!attribute [rw] corpus_data_path + # @return [::String] + # The Cloud Storage corpus data which could be associated in train data. + # The data path format is `gs:///`. + # A newline delimited jsonl/ndjson file. + # + # For search-tuning model, each line should have the _id, title + # and text. Example: + # `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}` + # @!attribute [rw] query_data_path + # @return [::String] + # The gcs query data which could be associated in train data. + # The data path format is `gs:///`. + # A newline delimited jsonl/ndjson file. + # + # For search-tuning model, each line should have the _id + # and text. Example: \\{"_id": "query1", "text": "example query"} + # @!attribute [rw] train_data_path + # @return [::String] + # Cloud Storage training data path whose format should be + # `gs:///`. The file should be in tsv + # format. Each line should have the doc_id and query_id and score (number). + # + # For search-tuning model, it should have the query-id corpus-id + # score as tsv file header. The score should be a number in `[0, inf+)`. + # The larger the number is, the more relevant the pair is. Example: + # + # * `query-id\tcorpus-id\tscore` + # * `query1\tdoc1\t1` + # @!attribute [rw] test_data_path + # @return [::String] + # Cloud Storage test data. Same format as train_data_path. If not provided, + # a random 80/20 train/test split will be performed on train_data_path. + class GcsTrainingInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response of the + # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest TrainCustomModelRequest}. + # This message is returned by the google.longrunning.Operations.response field. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the data. + # @!attribute [rw] error_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] + # Echoes the destination for the complete errors in the request if set. + # @!attribute [rw] model_status + # @return [::String] + # The trained model status. Possible values are: + # + # * **bad-data**: The training data quality is bad. + # * **no-improvement**: Tuning didn't improve performance. Won't deploy. + # * **in-progress**: Model training job creation is in progress. + # * **training**: Model is actively training. + # * **evaluating**: The model is evaluating trained metrics. + # * **indexing**: The model trained metrics are indexing. + # * **ready**: The model is ready for serving. + # @!attribute [rw] metrics + # @return [::Google::Protobuf::Map{::String => ::Float}] + # The metrics of the trained model. + # @!attribute [rw] model_name + # @return [::String] + # Fully qualified name of the CustomTuningModel. + class TrainCustomModelResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Float] + class MetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata related to the progress of the TrainCustomModel operation. This is + # returned by the google.longrunning.Operation.metadata field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class TrainCustomModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb new file mode 100644 index 000000000000..2cf0313e59af --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb @@ -0,0 +1,261 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Configures metadata that is used to generate serving time results (e.g. + # search results or recommendation predictions). + # The ServingConfig is passed in the search and predict request and generates + # results. + # @!attribute [rw] media_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig::MediaConfig] + # The MediaConfig of the serving configuration. + # + # Note: The following fields are mutually exclusive: `media_config`, `generic_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] generic_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig::GenericConfig] + # The GenericConfig of the serving configuration. + # + # Note: The following fields are mutually exclusive: `generic_config`, `media_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` + # @!attribute [rw] display_name + # @return [::String] + # Required. The human readable serving config display name. Used in Discovery + # UI. + # + # This field must be a UTF-8 encoded string with a length limit of 128 + # characters. Otherwise, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] solution_type + # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] + # Required. Immutable. Specifies the solution type that a serving config can + # be associated with. + # @!attribute [rw] model_id + # @return [::String] + # The id of the model to use at serving time. + # Currently only RecommendationModels are supported. + # Can be changed but only to a compatible model (e.g. + # others-you-may-like CTR to others-you-may-like CVR). + # + # Required when {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} + # is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] diversity_level + # @return [::String] + # How much diversity to use in recommendation model results e.g. + # `medium-diversity` or `high-diversity`. Currently supported values: + # + # * `no-diversity` + # * `low-diversity` + # * `medium-diversity` + # * `high-diversity` + # * `auto-diversity` + # + # If not specified, we choose default based on recommendation model + # type. Default value: `no-diversity`. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] ranking_expression + # @return [::String] + # The ranking expression controls the customized ranking on retrieval + # documents. To leverage this, document embedding is required. The ranking + # expression setting in ServingConfig applies to all search requests served + # by the serving config. However, if `SearchRequest.ranking_expression` is + # specified, it overrides the ServingConfig ranking expression. + # + # The ranking expression is a single function or multiple functions that are + # joined 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)`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. ServingConfig created timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. ServingConfig updated timestamp. + # @!attribute [rw] filter_control_ids + # @return [::Array<::String>] + # Filter controls to use in serving path. + # All triggered filter controls will be applied. + # Filter controls must be in the same data store as the serving config. + # Maximum of 20 filter controls. + # @!attribute [rw] boost_control_ids + # @return [::Array<::String>] + # Boost controls to use in serving path. + # All triggered boost controls will be applied. + # Boost controls must be in the same data store as the serving config. + # Maximum of 20 boost controls. + # @!attribute [rw] redirect_control_ids + # @return [::Array<::String>] + # IDs of the redirect controls. Only the first triggered redirect + # action is applied, even if multiple apply. Maximum number of + # specifications is 100. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] synonyms_control_ids + # @return [::Array<::String>] + # Condition synonyms specifications. If multiple synonyms conditions + # match, all matching synonyms controls in the list will execute. + # Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] oneway_synonyms_control_ids + # @return [::Array<::String>] + # Condition oneway synonyms specifications. If multiple oneway synonyms + # conditions match, all matching oneway synonyms controls in the list + # will execute. Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] dissociate_control_ids + # @return [::Array<::String>] + # Condition do not associate specifications. If multiple do not + # associate conditions match, all matching do not associate controls in + # the list will execute. + # Order does not matter. + # Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] replacement_control_ids + # @return [::Array<::String>] + # Condition replacement specifications. + # Applied according to the order in the list. + # A previously replaced term can not be re-replaced. + # Maximum number of specifications is 100. + # + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. + # @!attribute [rw] ignore_control_ids + # @return [::Array<::String>] + # Condition ignore specifications. If multiple ignore + # conditions match, all matching ignore controls in the list will + # execute. + # Order does not matter. + # Maximum number of specifications is 100. + # @!attribute [rw] promote_control_ids + # @return [::Array<::String>] + # Condition promote specifications. + # + # Maximum number of specifications is 100. + class ServingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the configurations needed for Media Discovery. Currently we + # support: + # + # * `demote_content_watched`: Threshold for watched content demotion. + # Customers can specify if using watched content demotion or use viewed + # detail page. Using the content watched demotion, customers need to specify + # the watched minutes or percentage exceeds the threshold, the content will + # be demoted in the recommendation result. + # * `promote_fresh_content`: cutoff days for fresh content promotion. + # Customers can specify if using content freshness promotion. If the content + # was published within the cutoff days, the content will be promoted in the + # recommendation result. + # Can only be set if + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is + # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. + # @!attribute [rw] content_watched_percentage_threshold + # @return [::Float] + # Specifies the content watched percentage threshold for demotion. + # Threshold value must be between [0, 1.0] inclusive. + # + # Note: The following fields are mutually exclusive: `content_watched_percentage_threshold`, `content_watched_seconds_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] content_watched_seconds_threshold + # @return [::Float] + # Specifies the content watched minutes threshold for demotion. + # + # Note: The following fields are mutually exclusive: `content_watched_seconds_threshold`, `content_watched_percentage_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] demotion_event_type + # @return [::String] + # Specifies the event type used for demoting recommendation result. + # Currently supported values: + # + # * `view-item`: Item viewed. + # * `media-play`: Start/resume watching a video, playing a song, etc. + # * `media-complete`: Finished or stopped midway through a video, song, + # etc. + # + # If unset, watch history demotion will not be applied. Content freshness + # demotion will still be applied. + # @!attribute [rw] demote_content_watched_past_days + # @return [::Integer] + # Optional. Specifies the number of days to look back for demoting watched + # content. If set to zero or unset, defaults to the maximum of 365 days. + # @!attribute [rw] content_freshness_cutoff_days + # @return [::Integer] + # Specifies the content freshness used for recommendation result. + # Contents will be demoted if contents were published for more than content + # freshness cutoff days. + class MediaConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the configurations needed for Generic Discovery.Currently we + # support: + # + # * `content_search_spec`: configuration for generic content search. + # @!attribute [rw] content_search_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec] + # Specifies the expected behavior of content search. + # Only valid for content-search enabled data store. + class GenericConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb new file mode 100644 index 000000000000..471f1b569e08 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request for UpdateServingConfig method. + # @!attribute [rw] serving_config + # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] + # Required. The ServingConfig to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Indicates which fields in the provided + # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. + # The following are NOT supported: + # + # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} + # + # If not set, all supported fields are updated. + class UpdateServingConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb new file mode 100644 index 000000000000..4f1cf4d4d1f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # External session proto definition. + # @!attribute [rw] name + # @return [::String] + # Immutable. Fully qualified name + # `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the session. + # + # This field is used to identify the session in the UI. + # By default, the display name is the first turn query text in the session. + # @!attribute [rw] state + # @return [::Google::Cloud::DiscoveryEngine::V1::Session::State] + # The state of the session. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # A unique identifier for tracking users. + # @!attribute [rw] turns + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Session::Turn>] + # Turns. + # @!attribute [rw] labels + # @return [::Array<::String>] + # Optional. The labels for the session. + # Can be set as filter in ListSessionsRequest. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the session started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the session finished. + # @!attribute [rw] is_pinned + # @return [::Boolean] + # Optional. Whether the session is pinned, pinned session will be displayed + # on the top of the session list. + class Session + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a turn, including a query from the user and a + # answer from service. + # @!attribute [rw] query + # @return [::Google::Cloud::DiscoveryEngine::V1::Query] + # Optional. The user query. May not be set if this turn is merely + # regenerating an answer to a different turn + # @!attribute [rw] answer + # @return [::String] + # Optional. The resource name of the answer to the user query. + # + # Only set if the answer generation (/answer API call) happened in this + # turn. + # @!attribute [r] detailed_answer + # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] + # Output only. In + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} + # API, if + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest#include_answer_details GetSessionRequest.include_answer_details} + # is set to true, this field will be populated when getting answer query + # session. + # @!attribute [r] detailed_assist_answer + # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer] + # Output only. In + # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} + # API, if + # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest#include_answer_details GetSessionRequest.include_answer_details} + # is set to true, this field will be populated when getting assistant + # session. + # @!attribute [rw] query_config + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Represents metadata related to the query config, for example + # LLM model and version used, model parameters (temperature, grounding + # parameters, etc.). The prefix "google." is reserved for Google-developed + # functionality. + class Turn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class QueryConfigEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Enumeration of the state of the session. + module State + # State is unspecified. + STATE_UNSPECIFIED = 0 + + # The session is currently open. + IN_PROGRESS = 1 + end + end + + # Defines a user inputed query. + # @!attribute [rw] text + # @return [::String] + # Plain text. + # @!attribute [r] query_id + # @return [::String] + # Output only. Unique Id for the query. + class Query + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb new file mode 100644 index 000000000000..47153c087ee7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb @@ -0,0 +1,186 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # SiteSearchEngine captures DataStore level site search persisting + # configurations. It is a singleton value per data store. + # @!attribute [rw] name + # @return [::String] + # The fully qualified resource name of the site search engine. + # Format: `projects/*/locations/*/dataStores/*/siteSearchEngine` + class SiteSearchEngine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A target site for the SiteSearchEngine. + # @!attribute [r] name + # @return [::String] + # Output only. The fully qualified resource name of the target site. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` + # The `target_site_id` is system-generated. + # @!attribute [rw] provided_uri_pattern + # @return [::String] + # Required. Input only. The user provided URI pattern from which the + # `generated_uri_pattern` is generated. + # @!attribute [rw] type + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::Type] + # The type of the target site, e.g., whether the site is to be included or + # excluded. + # @!attribute [rw] exact_match + # @return [::Boolean] + # Immutable. If set to false, a uri_pattern is generated to include all pages + # whose address contains the provided_uri_pattern. If set to true, an + # uri_pattern is generated to try to be an exact match of the + # provided_uri_pattern or just the specific page if the provided_uri_pattern + # is a specific one. provided_uri_pattern is always normalized to + # generate the URI pattern to be used by the search engine. + # @!attribute [r] generated_uri_pattern + # @return [::String] + # Output only. This is system-generated based on the provided_uri_pattern. + # @!attribute [r] root_domain_uri + # @return [::String] + # Output only. Root domain of the provided_uri_pattern. + # @!attribute [r] site_verification_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteVerificationInfo] + # Output only. Site ownership and validity verification status. + # @!attribute [r] indexing_status + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::IndexingStatus] + # Output only. Indexing status. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The target site's last updated time. + # @!attribute [r] failure_reason + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::FailureReason] + # Output only. Failure reason. + class TargetSite + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Site search indexing failure reasons. + # @!attribute [rw] quota_failure + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::FailureReason::QuotaFailure] + # Failed due to insufficient quota. + class FailureReason + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Failed due to insufficient quota. + # @!attribute [rw] total_required_quota + # @return [::Integer] + # This number is an estimation on how much total quota this project needs + # to successfully complete indexing. + class QuotaFailure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Possible target site types. + module Type + # This value is unused. In this case, server behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite::Type::INCLUDE Type.INCLUDE}. + TYPE_UNSPECIFIED = 0 + + # Include the target site. + INCLUDE = 1 + + # Exclude the target site. + EXCLUDE = 2 + end + + # Target site indexing status enumeration. + module IndexingStatus + # Defaults to SUCCEEDED. + INDEXING_STATUS_UNSPECIFIED = 0 + + # The target site is in the update queue and will be picked up by indexing + # pipeline. + PENDING = 1 + + # The target site fails to be indexed. + FAILED = 2 + + # The target site has been indexed. + SUCCEEDED = 3 + + # The previously indexed target site has been marked to be deleted. This is + # a transitioning state which will resulted in either: + # 1. target site deleted if unindexing is successful; + # 2. state reverts to SUCCEEDED if the unindexing fails. + DELETING = 4 + + # The target site change is pending but cancellable. + CANCELLABLE = 5 + + # The target site change is cancelled. + CANCELLED = 6 + end + end + + # Verification information for target sites in advanced site search. + # @!attribute [rw] site_verification_state + # @return [::Google::Cloud::DiscoveryEngine::V1::SiteVerificationInfo::SiteVerificationState] + # Site verification state indicating the ownership and validity. + # @!attribute [rw] verify_time + # @return [::Google::Protobuf::Timestamp] + # Latest site verification time. + class SiteVerificationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Site verification state. + module SiteVerificationState + # Defaults to VERIFIED. + SITE_VERIFICATION_STATE_UNSPECIFIED = 0 + + # Site ownership verified. + VERIFIED = 1 + + # Site ownership pending verification or verification failed. + UNVERIFIED = 2 + + # Site exempt from verification, e.g., a public website that opens to all. + EXEMPTED = 3 + end + end + + # A sitemap for the SiteSearchEngine. + # @!attribute [rw] uri + # @return [::String] + # Public URI for the sitemap, e.g. `www.example.com/sitemap.xml`. + # @!attribute [r] name + # @return [::String] + # Output only. The fully qualified resource name of the sitemap. + # `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/sitemaps/*` + # The `sitemap_id` suffix is system-generated. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The sitemap's creation time. + class Sitemap + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb new file mode 100644 index 000000000000..7f087d84968a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb @@ -0,0 +1,672 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine SiteSearchEngineService.GetSiteSearchEngine} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to access the [SiteSearchEngine], + # regardless of whether or not it exists, a PERMISSION_DENIED error is + # returned. + class GetSiteSearchEngineRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site SiteSearchEngineService.CreateTargetSite} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @!attribute [rw] target_site + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to + # create. + class CreateTargetSiteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site SiteSearchEngineService.CreateTargetSite} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class CreateTargetSiteMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource shared by all TargetSites being created. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # The parent field in the CreateBookRequest messages must either be empty or + # match this field. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest>] + # Required. The request message specifying the resources to create. + # A maximum of 20 TargetSites can be created in a batch. + class BatchCreateTargetSitesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site SiteSearchEngineService.GetTargetSite} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + class GetTargetSiteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site SiteSearchEngineService.UpdateTargetSite} + # method. + # @!attribute [rw] target_site + # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] + # Required. The target site to update. + # If the caller does not have permission to update the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update + # does not exist, a NOT_FOUND error is returned. + class UpdateTargetSiteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site SiteSearchEngineService.UpdateTargetSite} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class UpdateTargetSiteMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site SiteSearchEngineService.DeleteTargetSite} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of + # whether or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} + # does not exist, a NOT_FOUND error is returned. + class DeleteTargetSiteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site SiteSearchEngineService.DeleteTargetSite} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteTargetSiteMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites SiteSearchEngineService.ListTargetSites} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent site search engine resource name, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # + # If the caller does not have permission to list + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site + # search engine, regardless of whether or not this branch exists, a + # PERMISSION_DENIED error is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListTargetSites` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargetSites` + # must match the call that provided the page token. + class ListTargetSitesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites SiteSearchEngineService.ListTargetSites} + # method. + # @!attribute [rw] target_sites + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # List of TargetSites. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of items matching the request. + # This will always be populated in the response. + class ListTargetSitesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class BatchCreateTargetSiteMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} + # method. + # @!attribute [rw] target_sites + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # TargetSites created. + class BatchCreateTargetSitesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap SiteSearchEngineService.CreateSitemap} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @!attribute [rw] sitemap + # @return [::Google::Cloud::DiscoveryEngine::V1::Sitemap] + # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. + class CreateSitemapRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap SiteSearchEngineService.DeleteSitemap} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Full resource name of + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. + # + # If the caller does not have permission to access the + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether + # or not it exists, a PERMISSION_DENIED error is returned. + # + # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does + # not exist, a NOT_FOUND error is returned. + class DeleteSitemapRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps SiteSearchEngineService.FetchSitemaps} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @!attribute [rw] matcher + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher] + # Optional. If specified, fetches the matching + # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, + # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. + class FetchSitemapsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s by + # their uris. + # @!attribute [rw] uris + # @return [::Array<::String>] + # The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} uris. + class UrisMatcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. + # Currently only supports uris matcher. + # @!attribute [rw] uris_matcher + # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::UrisMatcher] + # Matcher by sitemap URIs. + class Matcher + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap SiteSearchEngineService.CreateSitemap} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class CreateSitemapMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap SiteSearchEngineService.DeleteSitemap} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DeleteSitemapMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps SiteSearchEngineService.FetchSitemaps} + # method. + # @!attribute [rw] sitemaps_metadata + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse::SitemapMetadata>] + # List of {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s fetched. + class FetchSitemapsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} and its + # metadata. + # @!attribute [rw] sitemap + # @return [::Google::Cloud::DiscoveryEngine::V1::Sitemap] + # The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. + class SitemapMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} + # method. + # @!attribute [rw] site_search_engine + # @return [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + class EnableAdvancedSiteSearchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} + # method. + class EnableAdvancedSiteSearchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class EnableAdvancedSiteSearchMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} + # method. + # @!attribute [rw] site_search_engine + # @return [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as + # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. + class DisableAdvancedSiteSearchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} + # method. + class DisableAdvancedSiteSearchResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class DisableAdvancedSiteSearchMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} + # method. + # @!attribute [rw] site_search_engine + # @return [::String] + # Required. Full resource name of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such + # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. + # @!attribute [rw] uris + # @return [::Array<::String>] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in + # `site_search_engine`. + # @!attribute [rw] site_credential + # @return [::String] + # Optional. Credential id to use for crawling. + class RecrawlUrisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} + # method. + # @!attribute [rw] failure_samples + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo>] + # Details for a sample of up to 10 `failed_uris`. + # @!attribute [rw] failed_uris + # @return [::Array<::String>] + # URIs that were not crawled before the LRO terminated. + class RecrawlUrisResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details about why a particular URI failed to be crawled. Each FailureInfo + # contains one FailureReason per CorpusType. + # @!attribute [rw] uri + # @return [::String] + # URI that failed to be crawled. + # @!attribute [rw] failure_reasons + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo::FailureReason>] + # List of failure reasons by corpus type (e.g. desktop, mobile). + class FailureInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details about why crawling failed for a particular CorpusType, e.g., + # DESKTOP and MOBILE crawling may fail for different reasons. + # @!attribute [rw] corpus_type + # @return [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo::FailureReason::CorpusType] + # DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED. + # @!attribute [rw] error_message + # @return [::String] + # Reason why the URI was not crawled. + class FailureReason + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # CorpusType for the failed crawling operation. + module 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 + end + end + end + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] invalid_uris + # @return [::Array<::String>] + # Unique URIs in the request that have invalid format. Sample limited to + # 1000. + # @!attribute [rw] invalid_uris_count + # @return [::Integer] + # Total number of unique URIs in the request that have invalid format. + # @!attribute [rw] noindex_uris + # @return [::Array<::String>] + # URIs that have no index meta tag. Sample limited to 1000. + # @!attribute [rw] noindex_uris_count + # @return [::Integer] + # Total number of URIs that have no index meta tag. + # @!attribute [rw] uris_not_matching_target_sites + # @return [::Array<::String>] + # 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. Sample limited to 1000. + # @!attribute [rw] uris_not_matching_target_sites_count + # @return [::Integer] + # Total number of URIs that don't match any TargetSites. + # @!attribute [rw] valid_uris_count + # @return [::Integer] + # Total number of unique URIs in the request that are not in invalid_uris. + # @!attribute [rw] success_count + # @return [::Integer] + # Total number of URIs that have been crawled so far. + # @!attribute [rw] pending_count + # @return [::Integer] + # Total number of URIs that have yet to be crawled. + # @!attribute [rw] quota_exceeded_count + # @return [::Integer] + # Total number of URIs that were rejected due to insufficient indexing + # resources. + class RecrawlUrisMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource shared by all TargetSites being verified. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + class BatchVerifyTargetSitesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} + # method. + class BatchVerifyTargetSitesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + class BatchVerifyTargetSitesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status SiteSearchEngineService.FetchDomainVerificationStatus} + # method. + # @!attribute [rw] site_search_engine + # @return [::String] + # Required. The site search engine resource under which we fetch all the + # domain verification status. + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. If + # unspecified, server will pick an appropriate default. The maximum value is + # 1000; values above 1000 will be coerced to 1000. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `FetchDomainVerificationStatus` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `FetchDomainVerificationStatus` must match the call that provided the page + # token. + class FetchDomainVerificationStatusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status SiteSearchEngineService.FetchDomainVerificationStatus} + # method. + # @!attribute [rw] target_sites + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] + # List of TargetSites containing the site verification status. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of items matching the request. + # This will always be populated in the response. + class FetchDomainVerificationStatusResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb new file mode 100644 index 000000000000..3750ae14d954 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb @@ -0,0 +1,548 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # UserEvent captures all metadata information Discovery Engine API needs to + # know about how end users interact with your website. + # @!attribute [rw] event_type + # @return [::String] + # 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 + # * `add-feedback`: Add a user feedback. + # + # 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. + # + # Custom conversion value: + # + # * `conversion`: Customer defined conversion event. + # @!attribute [rw] conversion_type + # @return [::String] + # Optional. Conversion type. + # + # Required if + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} + # is `conversion`. This is a customer-defined conversion name in lowercase + # letters or numbers separated by "-", such as "watch", "good-visit" etc. + # + # Do not set the field if + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} + # is not `conversion`. This mixes the custom conversion event with predefined + # events like `search`, `view-item` etc. + # @!attribute [rw] user_pseudo_id + # @return [::String] + # 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. + # @!attribute [rw] engine + # @return [::String] + # The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} resource name, in the + # form of + # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. + # + # Optional. Only required for + # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} produced user events. For + # example, user events from blended search. + # @!attribute [rw] data_store + # @return [::String] + # The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} resource full + # name, of the form + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # + # Optional. Only required for user events whose data store can't by + # determined by + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#engine UserEvent.engine} or + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#documents UserEvent.documents}. + # If data store is set in the parent of write/import/collect user event + # requests, this field can be omitted. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Only required for + # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events UserEventService.ImportUserEvents} + # method. Timestamp of when the user event happened. + # @!attribute [rw] user_info + # @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo] + # Information about the end user. + # @!attribute [rw] direct_user_request + # @return [::Boolean] + # Should set to true if the request is made directly from the end user, in + # which case the + # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserEvent.user_info.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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent}. + # @!attribute [rw] session_id + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} + # as prefix. + # @!attribute [rw] page_info + # @return [::Google::Cloud::DiscoveryEngine::V1::PageInfo] + # Page metadata such as categories and other critical information for certain + # event types such as `view-category-page`. + # @!attribute [rw] attribution_token + # @return [::String] + # Token to attribute an API response to user action(s) to trigger the event. + # + # Highly recommended for user events that are the result of + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}. + # This field enables accurate attribution of recommendation model + # performance. + # + # The value must be one of: + # + # * {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} for events that are the result of + # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}. + # * {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token SearchResponse.attribution_token} for events that are the result of + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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 + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} + # as a URL parameter to product K's page. When recording events on product + # K's page, log the + # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} + # to this field. + # @!attribute [rw] filter + # @return [::String] + # 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 + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} may contain + # a filter expression in + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter} + # conforming to https://google.aip.dev/160#filtering. + # + # Similarly, for `view-item-list` events that are generated from a + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest RecommendRequest}, this + # field may be populated directly from + # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#filter 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. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DocumentInfo>] + # List of {::Google::Cloud::DiscoveryEngine::V1::Document 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 + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#documents UserEvent.documents} + # is desired. + # @!attribute [rw] panel + # @return [::Google::Cloud::DiscoveryEngine::V1::PanelInfo] + # Panel metadata associated with this user event. + # @!attribute [rw] search_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchInfo] + # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} + # details related to the event. + # + # This field should be set for `search` event. + # @!attribute [rw] completion_info + # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionInfo] + # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query 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. + # @!attribute [rw] transaction_info + # @return [::Google::Cloud::DiscoveryEngine::V1::TransactionInfo] + # The transaction metadata (if any) associated with this user event. + # @!attribute [rw] tag_ids + # @return [::Array<::String>] + # 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. + # @!attribute [rw] promotion_ids + # @return [::Array<::String>] + # The promotion IDs if this is an event associated with promotions. + # Currently, this field is restricted to at most one ID. + # @!attribute [rw] attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::CustomAttribute}] + # 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. + # @!attribute [rw] media_info + # @return [::Google::Cloud::DiscoveryEngine::V1::MediaInfo] + # Media-specific info. + # @!attribute [rw] panels + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::PanelInfo>] + # Optional. List of panels associated with this event. + # Used for page-level impression data. + class UserEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::CustomAttribute] + class AttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Detailed page information. + # @!attribute [rw] pageview_id + # @return [::String] + # 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. + # @!attribute [rw] page_category + # @return [::String] + # 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, 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. + # @!attribute [rw] uri + # @return [::String] + # 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. + # @!attribute [rw] referrer_uri + # @return [::String] + # 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. + class PageInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed search information. + # @!attribute [rw] search_query + # @return [::String] + # The user's search query. + # + # See + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query 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 + # {::Google::Cloud::DiscoveryEngine::V1::SearchInfo#search_query search_query} or + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category} + # is required for `search` events. Other event types should not set this + # field. Otherwise, an `INVALID_ARGUMENT` error is returned. + # @!attribute [rw] order_by + # @return [::String] + # The order in which products are returned, if applicable. + # + # See + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#order_by 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. + # @!attribute [rw] offset + # @return [::Integer] + # An integer that specifies the current offset for pagination (the 0-indexed + # starting location, amongst the products deemed by the API as relevant). + # + # See + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#offset 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. + class SearchInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed completion information including completion attribution token and + # clicked completion info. + # @!attribute [rw] selected_suggestion + # @return [::String] + # End user selected + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion#suggestion CompleteQueryResponse.QuerySuggestion.suggestion}. + # @!attribute [rw] selected_position + # @return [::Integer] + # End user selected + # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion#suggestion CompleteQueryResponse.QuerySuggestion.suggestion} + # position, starting from 0. + class CompletionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A transaction represents the entire purchase transaction. + # @!attribute [rw] value + # @return [::Float] + # 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. + # @!attribute [rw] currency + # @return [::String] + # Required. Currency code. Use three-character ISO-4217 code. + # @!attribute [rw] transaction_id + # @return [::String] + # The transaction ID with a length limit of 128 characters. + # @!attribute [rw] tax + # @return [::Float] + # All the taxes associated with the transaction. + # @!attribute [rw] cost + # @return [::Float] + # 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 = {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value value} - + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#tax tax} - + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#cost cost} + # @!attribute [rw] discount_value + # @return [::Float] + # The total discount(s) value applied to this transaction. + # This figure should be excluded from + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} + # + # For example, if a user paid + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} + # amount, then nominal (pre-discount) value of the transaction is the sum of + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} + # and + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#discount_value TransactionInfo.discount_value} + # + # This means that profit is calculated the same way, regardless of the + # discount value, and that + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#discount_value TransactionInfo.discount_value} + # can be larger than + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value}: + # + # * Profit = {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value value} - + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#tax tax} - + # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#cost cost} + class TransactionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed document information associated with a user event. + # @!attribute [rw] id + # @return [::String] + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} resource ID. + # + # Note: The following fields are mutually exclusive: `id`, `name`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} resource full + # name, of the form: + # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` + # + # Note: The following fields are mutually exclusive: `name`, `id`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] uri + # @return [::String] + # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} URI - only + # allowed for website data stores. + # + # Note: The following fields are mutually exclusive: `uri`, `id`, `name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] quantity + # @return [::Integer] + # Quantity of the Document associated with the user event. Defaults to 1. + # + # For example, this field is 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` + # @!attribute [rw] promotion_ids + # @return [::Array<::String>] + # The promotion IDs associated with this Document. + # Currently, this field is restricted to at most one ID. + # @!attribute [r] joined + # @return [::Boolean] + # Output only. Whether the referenced Document can be found in the data + # store. + # @!attribute [rw] conversion_value + # @return [::Float] + # Optional. The conversion value associated with this Document. + # Must be set if + # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} + # is "conversion". + # + # For example, a value of 1000 signifies that 1000 seconds were spent viewing + # a Document for the `watch` conversion type. + class DocumentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detailed panel information associated with a user event. + # @!attribute [rw] panel_id + # @return [::String] + # Required. The panel ID. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the panel. + # @!attribute [rw] panel_position + # @return [::Integer] + # The ordered position of the panel, if shown to the user with other panels. + # If set, then + # {::Google::Cloud::DiscoveryEngine::V1::PanelInfo#total_panels total_panels} must + # also be set. + # @!attribute [rw] total_panels + # @return [::Integer] + # The total number of panels, including this one, shown to the user. + # Must be set if + # {::Google::Cloud::DiscoveryEngine::V1::PanelInfo#panel_position panel_position} + # is set. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DocumentInfo>] + # Optional. The document IDs associated with this panel. + class PanelInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Media-specific user event information. + # @!attribute [rw] media_progress_duration + # @return [::Google::Protobuf::Duration] + # The media progress time in seconds, if applicable. + # For example, if the end user has finished 90 seconds of a playback video, + # then + # {::Google::Protobuf::Duration#seconds MediaInfo.media_progress_duration.seconds} + # should be set to 90. + # @!attribute [rw] media_progress_percentage + # @return [::Float] + # Media progress should be computed using only the + # {::Google::Cloud::DiscoveryEngine::V1::MediaInfo#media_progress_duration 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. + class MediaInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb new file mode 100644 index 000000000000..810fd4851846 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for WriteUserEvent method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # If the write user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the write user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] user_event + # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] + # Required. User event to write. + # @!attribute [rw] write_async + # @return [::Boolean] + # If set to true, the user event is written asynchronously after + # validation, and the API responds without waiting for the write. + class WriteUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CollectUserEvent method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # If the collect user event action is applied in + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format + # is: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. + # If the collect user event action is applied in + # [Location][google.cloud.location.Location] level, for example, the event + # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple + # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] user_event + # @return [::String] + # Required. URL encoded UserEvent proto with a length limit of 2,000,000 + # characters. + # @!attribute [rw] uri + # @return [::String] + # 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. + # @!attribute [rw] ets + # @return [::Integer] + # The event timestamp in milliseconds. This prevents browser caching of + # otherwise identical get requests. The name is abbreviated to reduce the + # payload bytes. + class CollectUserEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb new file mode 100644 index 000000000000..fd9ce0884a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # User License information assigned by the admin. + # @!attribute [rw] user_principal + # @return [::String] + # Required. Immutable. The user principal of the User, could be email address + # or other prinical identifier. This field is immutable. Admin assign + # licenses based on the user principal. + # @!attribute [rw] user_profile + # @return [::String] + # Optional. The user profile. + # We user user full name(First name + Last name) as user profile. + # @!attribute [r] license_assignment_state + # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicense::LicenseAssignmentState] + # Output only. License assignment state of the user. + # If the user is assigned with a license config, the user loggin will be + # assigned with the license; + # If the user's license assignment state is unassigned or unspecified, no + # license config will be associated to the user; + # @!attribute [rw] license_config + # @return [::String] + # Optional. The full resource name of the Subscription(LicenseConfig) + # assigned to the user. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. User created timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. User update timestamp. + # @!attribute [r] last_login_time + # @return [::Google::Protobuf::Timestamp] + # Output only. User last logged in time. + # If the user has not logged in yet, this field will be empty. + class UserLicense + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # License assignment state enumeration. + module LicenseAssignmentState + # Default value. + LICENSE_ASSIGNMENT_STATE_UNSPECIFIED = 0 + + # License assigned to the user. + ASSIGNED = 1 + + # No license assigned to the user. + # Deprecated, translated to NO_LICENSE. + UNASSIGNED = 2 + + # No license assigned to the user. + NO_LICENSE = 3 + + # User attempted to login but no license assigned to the user. + # This state is only used for no user first time login attempt but cannot + # get license assigned. + # Users already logged in but cannot get license assigned will be assigned + # NO_LICENSE state(License could be unassigned by admin). + NO_LICENSE_ATTEMPTED_LOGIN = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb new file mode 100644 index 000000000000..6f76cd96c489 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DiscoveryEngine + module V1 + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses UserLicenseService.ListUserLicenses}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, defaults to 10. The maximum value is 50; values + # above 50 will be coerced to 50. + # + # If this field is negative, an INVALID_ARGUMENT error is returned. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListUserLicenses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUserLicenses` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter for the list request. + # + # Supported fields: + # + # * `license_assignment_state` + # + # Examples: + # + # * `license_assignment_state = ASSIGNED` to list assigned user licenses. + # * `license_assignment_state = NO_LICENSE` to list not licensed users. + # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users + # who attempted login but no license assigned. + # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter + # out users who attempted login but no license assigned. + class ListUserLicensesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses UserLicenseService.ListUserLicenses}. + # @!attribute [rw] user_licenses + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # All the customer's + # {::Google::Cloud::DiscoveryEngine::V1::UserLicense UserLicense}s. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. If + # this field is omitted, there are no subsequent pages. + class ListUserLicensesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} + # method. + # @!attribute [rw] inline_source + # @return [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource] + # The inline source for the input content for document embeddings. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent [UserStore][] resource name, format: + # `projects/{project}/locations/{location}/userStores/{user_store_id}`. + # @!attribute [rw] delete_unassigned_user_licenses + # @return [::Boolean] + # Optional. If true, if user licenses removed associated license config, the + # user license will be deleted. By default which is false, the user license + # will be updated to unassigned state. + class BatchUpdateUserLicensesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inline source for the input config for BatchUpdateUserLicenses + # method. + # @!attribute [rw] user_licenses + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # Required. A list of user licenses to update. Each user license + # must have a valid + # {::Google::Cloud::DiscoveryEngine::V1::UserLicense#user_principal UserLicense.user_principal}. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update. + class InlineSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata related to the progress of the + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} + # operation. This will be returned by the google.longrunning.Operation.metadata + # field. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Operation create time. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Operation last update time. If the operation is done, this is also the + # finish time. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of user licenses successfully updated. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of user licenses that failed to be updated. + class BatchUpdateUserLicensesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} + # method. + # @!attribute [rw] user_licenses + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] + # UserLicenses successfully updated. + # @!attribute [rw] error_samples + # @return [::Array<::Google::Rpc::Status>] + # A sample of errors encountered while processing the request. + class BatchUpdateUserLicensesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..1d0a9780457f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a whole or partial calendar date, such as a birthday. The time of + # day and time zone are either specified elsewhere or are insignificant. The + # date is relative to the Gregorian Calendar. This can represent one of the + # following: + # + # * A full date, with non-zero year, month, and day values + # * A month and day value, with a zero year, such as an anniversary + # * A year on its own, with zero month and day values + # * A year and month value, with a zero day, such as a credit card expiration + # date + # + # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] year + # @return [::Integer] + # Year of the date. Must be from 1 to 9999, or 0 to specify a date without + # a year. + # @!attribute [rw] month + # @return [::Integer] + # Month of a year. Must be from 1 to 12, or 0 to specify a year without a + # month and day. + # @!attribute [rw] day + # @return [::Integer] + # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + # to specify a year by itself or a year and month where the day isn't + # significant. + class Date + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile new file mode 100644 index 000000000000..e929583d3d35 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-discovery_engine-v1", path: "../" +else + gem "google-cloud-discovery_engine-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb new file mode 100644 index 000000000000..65965d3696d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_AssistantService_StreamAssist_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the stream_assist call in the AssistantService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist. +# +def stream_assist + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new + + # Call the stream_assist method to start streaming. + output = client.stream_assist request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse + output.each do |current_response| + p current_response + end +end +# [END discoveryengine_v1_generated_AssistantService_StreamAssist_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb new file mode 100644 index 000000000000..36e2f5047a22 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_cmek_config call in the CmekConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config. +# +def delete_cmek_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new + + # Call the delete_cmek_config method. + result = client.delete_cmek_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb new file mode 100644 index 000000000000..008b493423cd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_cmek_config call in the CmekConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config. +# +def get_cmek_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new + + # Call the get_cmek_config method. + result = client.get_cmek_config request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. + p result +end +# [END discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb new file mode 100644 index 000000000000..beac68861b79 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_cmek_configs call in the CmekConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs. +# +def list_cmek_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new + + # Call the list_cmek_configs method. + result = client.list_cmek_configs request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. + p result +end +# [END discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb new file mode 100644 index 000000000000..4288e43e8481 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_cmek_config call in the CmekConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config. +# +def update_cmek_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new + + # Call the update_cmek_config method. + result = client.update_cmek_config request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb new file mode 100644 index 000000000000..fdb3ee82baa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CompletionService_CompleteQuery_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the complete_query call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query. +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new + + # Call the complete_query method. + result = client.complete_query request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. + p result +end +# [END discoveryengine_v1_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb new file mode 100644 index 000000000000..1b49f14e488b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the import_completion_suggestions call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions. +# +def import_completion_suggestions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new + + # Call the import_completion_suggestions method. + result = client.import_completion_suggestions request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb new file mode 100644 index 000000000000..f07ad5b71042 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the import_suggestion_deny_list_entries call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries. +# +def import_suggestion_deny_list_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new + + # Call the import_suggestion_deny_list_entries method. + result = client.import_suggestion_deny_list_entries request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb new file mode 100644 index 000000000000..7a1cc161fa7f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the purge_completion_suggestions call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions. +# +def purge_completion_suggestions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new + + # Call the purge_completion_suggestions method. + result = client.purge_completion_suggestions request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb new file mode 100644 index 000000000000..3c93ea0b0cff --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the purge_suggestion_deny_list_entries call in the CompletionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries. +# +def purge_suggestion_deny_list_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new + + # Call the purge_suggestion_deny_list_entries method. + result = client.purge_suggestion_deny_list_entries request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb new file mode 100644 index 000000000000..c86c2700b384 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ControlService_CreateControl_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control. +# +def create_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new + + # Call the create_control method. + result = client.create_control request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + p result +end +# [END discoveryengine_v1_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb new file mode 100644 index 000000000000..e4a1060af977 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ControlService_DeleteControl_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control. +# +def delete_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new + + # Call the delete_control method. + result = client.delete_control request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END discoveryengine_v1_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb new file mode 100644 index 000000000000..e7185d6584ba --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ControlService_GetControl_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control. +# +def get_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new + + # Call the get_control method. + result = client.get_control request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + p result +end +# [END discoveryengine_v1_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb new file mode 100644 index 000000000000..8307266affb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ControlService_ListControls_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_controls call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls. +# +def list_controls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new + + # Call the list_controls method. + result = client.list_controls request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. + p item + end +end +# [END discoveryengine_v1_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb new file mode 100644 index 000000000000..0bb33b6aa06e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ControlService_UpdateControl_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_control call in the ControlService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control. +# +def update_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new + + # Call the update_control method. + result = client.update_control request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. + p result +end +# [END discoveryengine_v1_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb new file mode 100644 index 000000000000..b81be0ee2c70 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the answer_query call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query. +# +def answer_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + + # Call the answer_query method. + result = client.answer_query request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb new file mode 100644 index 000000000000..be914e4b5ad3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the converse_conversation call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation. +# +def converse_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new + + # Call the converse_conversation method. + result = client.converse_conversation request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb new file mode 100644 index 000000000000..50b9599f3e81 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_conversation call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation. +# +def create_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new + + # Call the create_conversation method. + result = client.create_conversation request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb new file mode 100644 index 000000000000..0ed3dce9bfbc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_session call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb new file mode 100644 index 000000000000..423f7b02e0d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_conversation call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation. +# +def delete_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new + + # Call the delete_conversation method. + result = client.delete_conversation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb new file mode 100644 index 000000000000..072f057557d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_session call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb new file mode 100644 index 000000000000..8f900b2fb442 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_answer call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer. +# +def get_answer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new + + # Call the get_answer method. + result = client.get_answer request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb new file mode 100644 index 000000000000..a883922f2ed7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_conversation call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation. +# +def get_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new + + # Call the get_conversation method. + result = client.get_conversation request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb new file mode 100644 index 000000000000..5733d8ed7b1a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_session call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb new file mode 100644 index 000000000000..fad72b597cff --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_conversations call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations. +# +def list_conversations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new + + # Call the list_conversations method. + result = client.list_conversations request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. + p item + end +end +# [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb new file mode 100644 index 000000000000..ccd5a301f826 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_sessions call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + p item + end +end +# [END discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb new file mode 100644 index 000000000000..1e42431ff85d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the stream_answer_query call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query. +# +def stream_answer_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new + + # Call the stream_answer_query method to start streaming. + output = client.stream_answer_query request + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse + output.each do |current_response| + p current_response + end +end +# [END discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb new file mode 100644 index 000000000000..f82d0851ed5e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_conversation call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation. +# +def update_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new + + # Call the update_conversation method. + result = client.update_conversation request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb new file mode 100644 index 000000000000..c3be7879b19a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_session call in the ConversationalSearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session. +# +def update_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + + # Call the update_session method. + result = client.update_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb new file mode 100644 index 000000000000..464291fe665e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_data_store call in the DataStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store. +# +def create_data_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new + + # Call the create_data_store method. + result = client.create_data_store request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb new file mode 100644 index 000000000000..dba4d66036bb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_data_store call in the DataStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store. +# +def delete_data_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new + + # Call the delete_data_store method. + result = client.delete_data_store request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb new file mode 100644 index 000000000000..f1a50c12c943 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DataStoreService_GetDataStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_data_store call in the DataStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store. +# +def get_data_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new + + # Call the get_data_store method. + result = client.get_data_store request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + p result +end +# [END discoveryengine_v1_generated_DataStoreService_GetDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb new file mode 100644 index 000000000000..39a3f6f16ed2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DataStoreService_ListDataStores_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_data_stores call in the DataStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores. +# +def list_data_stores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new + + # Call the list_data_stores method. + result = client.list_data_stores request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. + p item + end +end +# [END discoveryengine_v1_generated_DataStoreService_ListDataStores_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb new file mode 100644 index 000000000000..2c6fb15de6c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_data_store call in the DataStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store. +# +def update_data_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new + + # Call the update_data_store method. + result = client.update_data_store request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. + p result +end +# [END discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb new file mode 100644 index 000000000000..9ca373128273 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the batch_get_documents_metadata call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata. +# +def batch_get_documents_metadata + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new + + # Call the batch_get_documents_metadata method. + result = client.batch_get_documents_metadata request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. + p result +end +# [END discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb new file mode 100644 index 000000000000..07003bd16906 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_CreateDocument_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_document call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document. +# +def create_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new + + # Call the create_document method. + result = client.create_document request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + p result +end +# [END discoveryengine_v1_generated_DocumentService_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb new file mode 100644 index 000000000000..0b4eee511fef --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_DeleteDocument_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_document call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document. +# +def delete_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new + + # Call the delete_document method. + result = client.delete_document request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END discoveryengine_v1_generated_DocumentService_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb new file mode 100644 index 000000000000..053245047939 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_GetDocument_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_document call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document. +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new + + # Call the get_document method. + result = client.get_document request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + p result +end +# [END discoveryengine_v1_generated_DocumentService_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb new file mode 100644 index 000000000000..5ed7a5b61275 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_ImportDocuments_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the import_documents call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents. +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new + + # Call the import_documents method. + result = client.import_documents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_DocumentService_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb new file mode 100644 index 000000000000..f34642996f84 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_ListDocuments_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_documents call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents. +# +def list_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new + + # Call the list_documents method. + result = client.list_documents request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. + p item + end +end +# [END discoveryengine_v1_generated_DocumentService_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb new file mode 100644 index 000000000000..5abfe1031312 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the purge_documents call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents. +# +def purge_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new + + # Call the purge_documents method. + result = client.purge_documents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb new file mode 100644 index 000000000000..b248a2efc5ca --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_DocumentService_UpdateDocument_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_document call in the DocumentService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document. +# +def update_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new + + # Call the update_document method. + result = client.update_document request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + p result +end +# [END discoveryengine_v1_generated_DocumentService_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb new file mode 100644 index 000000000000..0134182dd1fe --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_EngineService_CreateEngine_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_engine call in the EngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine. +# +def create_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new + + # Call the create_engine method. + result = client.create_engine request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_EngineService_CreateEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb new file mode 100644 index 000000000000..b0e453601e3b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_EngineService_DeleteEngine_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_engine call in the EngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine. +# +def delete_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new + + # Call the delete_engine method. + result = client.delete_engine request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_EngineService_DeleteEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb new file mode 100644 index 000000000000..ee5db2f66986 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_EngineService_GetEngine_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_engine call in the EngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine. +# +def get_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new + + # Call the get_engine method. + result = client.get_engine request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + p result +end +# [END discoveryengine_v1_generated_EngineService_GetEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb new file mode 100644 index 000000000000..b07b445b88e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_EngineService_ListEngines_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_engines call in the EngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines. +# +def list_engines + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new + + # Call the list_engines method. + result = client.list_engines request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. + p item + end +end +# [END discoveryengine_v1_generated_EngineService_ListEngines_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb new file mode 100644 index 000000000000..5a9350054710 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_EngineService_UpdateEngine_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_engine call in the EngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine. +# +def update_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new + + # Call the update_engine method. + result = client.update_engine request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. + p result +end +# [END discoveryengine_v1_generated_EngineService_UpdateEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb new file mode 100644 index 000000000000..0439610ef869 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the check_grounding call in the GroundedGenerationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding. +# +def check_grounding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new + + # Call the check_grounding method. + result = client.check_grounding request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. + p result +end +# [END discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb new file mode 100644 index 000000000000..566065b34e7d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the generate_grounded_content call in the GroundedGenerationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content. +# +def generate_grounded_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + + # Call the generate_grounded_content method. + result = client.generate_grounded_content request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. + p result +end +# [END discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb new file mode 100644 index 000000000000..62695d2e251a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the stream_generate_grounded_content call in the GroundedGenerationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content. +# +def stream_generate_grounded_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the stream_generate_grounded_content method to start streaming. + output = client.stream_generate_grounded_content input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse + output.each do |current_response| + p current_response + end +end +# [END discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb new file mode 100644 index 000000000000..76b5a3a559be --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_identity_mapping_store call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store. +# +def create_identity_mapping_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new + + # Call the create_identity_mapping_store method. + result = client.create_identity_mapping_store request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + p result +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb new file mode 100644 index 000000000000..455bdc992508 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_identity_mapping_store call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store. +# +def delete_identity_mapping_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new + + # Call the delete_identity_mapping_store method. + result = client.delete_identity_mapping_store request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb new file mode 100644 index 000000000000..71a1c0f15081 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_identity_mapping_store call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store. +# +def get_identity_mapping_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new + + # Call the get_identity_mapping_store method. + result = client.get_identity_mapping_store request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + p result +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb new file mode 100644 index 000000000000..2f8b469f72a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the import_identity_mappings call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings. +# +def import_identity_mappings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new + + # Call the import_identity_mappings method. + result = client.import_identity_mappings request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb new file mode 100644 index 000000000000..8020429b17a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_identity_mapping_stores call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores. +# +def list_identity_mapping_stores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new + + # Call the list_identity_mapping_stores method. + result = client.list_identity_mapping_stores request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. + p item + end +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb new file mode 100644 index 000000000000..49d0549d3e11 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_identity_mappings call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings. +# +def list_identity_mappings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new + + # Call the list_identity_mappings method. + result = client.list_identity_mappings request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. + p item + end +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb new file mode 100644 index 000000000000..efea280f90e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the purge_identity_mappings call in the IdentityMappingStoreService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings. +# +def purge_identity_mappings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new + + # Call the purge_identity_mappings method. + result = client.purge_identity_mappings request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb new file mode 100644 index 000000000000..fccf226e1812 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ProjectService_ProvisionProject_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the provision_project call in the ProjectService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project. +# +def provision_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new + + # Call the provision_project method. + result = client.provision_project request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_ProjectService_ProvisionProject_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb new file mode 100644 index 000000000000..e46fc58ed78b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_RankService_Rank_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the rank call in the RankService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank. +# +def rank + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::RankService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new + + # Call the rank method. + result = client.rank request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. + p result +end +# [END discoveryengine_v1_generated_RankService_Rank_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb new file mode 100644 index 000000000000..535c51ab222c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_RecommendationService_Recommend_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the recommend call in the RecommendationService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend. +# +def recommend + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new + + # Call the recommend method. + result = client.recommend request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. + p result +end +# [END discoveryengine_v1_generated_RecommendationService_Recommend_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb new file mode 100644 index 000000000000..57f6fbb56b84 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SchemaService_CreateSchema_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema. +# +def create_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new + + # Call the create_schema method. + result = client.create_schema request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb new file mode 100644 index 000000000000..d6fcc2cbc50a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SchemaService_DeleteSchema_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema. +# +def delete_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new + + # Call the delete_schema method. + result = client.delete_schema request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb new file mode 100644 index 000000000000..be5145e3a025 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SchemaService_GetSchema_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema. +# +def get_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new + + # Call the get_schema method. + result = client.get_schema request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. + p result +end +# [END discoveryengine_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb new file mode 100644 index 000000000000..94b9d4fe73cc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SchemaService_ListSchemas_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_schemas call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas. +# +def list_schemas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new + + # Call the list_schemas method. + result = client.list_schemas request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. + p item + end +end +# [END discoveryengine_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb new file mode 100644 index 000000000000..c56df671712e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SchemaService_UpdateSchema_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_schema call in the SchemaService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema. +# +def update_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new + + # Call the update_schema method. + result = client.update_schema request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SchemaService_UpdateSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb new file mode 100644 index 000000000000..b8cbadac99e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SearchService_Search_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the search call in the SearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search. +# +def search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + + # Call the search method. + result = client.search request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + p item + end +end +# [END discoveryengine_v1_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb new file mode 100644 index 000000000000..8266197679b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SearchService_SearchLite_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the search_lite call in the SearchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite. +# +def search_lite + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + + # Call the search_lite method. + result = client.search_lite request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + p item + end +end +# [END discoveryengine_v1_generated_SearchService_SearchLite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb new file mode 100644 index 000000000000..8c0d99061206 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_custom_models call in the SearchTuningService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models. +# +def list_custom_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new + + # Call the list_custom_models method. + result = client.list_custom_models request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. + p result +end +# [END discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb new file mode 100644 index 000000000000..64e56ece4a1f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the train_custom_model call in the SearchTuningService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model. +# +def train_custom_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new + + # Call the train_custom_model method. + result = client.train_custom_model request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb new file mode 100644 index 000000000000..347761a4bf51 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_serving_config call in the ServingConfigService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config. +# +def update_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new + + # Call the update_serving_config method. + result = client.update_serving_config request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. + p result +end +# [END discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb new file mode 100644 index 000000000000..9df455d26df6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SessionService_CreateSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_session call in the SessionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_SessionService_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb new file mode 100644 index 000000000000..399efe09ac18 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SessionService_DeleteSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_session call in the SessionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END discoveryengine_v1_generated_SessionService_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb new file mode 100644 index 000000000000..f9205279fe2c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SessionService_GetSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_session call in the SessionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_SessionService_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb new file mode 100644 index 000000000000..0a47314c1dd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SessionService_ListSessions_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_sessions call in the SessionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. + p item + end +end +# [END discoveryengine_v1_generated_SessionService_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb new file mode 100644 index 000000000000..8ca24577692e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SessionService_UpdateSession_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_session call in the SessionService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session. +# +def update_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new + + # Call the update_session method. + result = client.update_session request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. + p result +end +# [END discoveryengine_v1_generated_SessionService_UpdateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb new file mode 100644 index 000000000000..1f16fd4bc426 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the batch_create_target_sites call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites. +# +def batch_create_target_sites + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new + + # Call the batch_create_target_sites method. + result = client.batch_create_target_sites request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb new file mode 100644 index 000000000000..7b79d8287f49 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the batch_verify_target_sites call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites. +# +def batch_verify_target_sites + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new + + # Call the batch_verify_target_sites method. + result = client.batch_verify_target_sites request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb new file mode 100644 index 000000000000..7fd5daab55cf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_sitemap call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap. +# +def create_sitemap + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new + + # Call the create_sitemap method. + result = client.create_sitemap request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb new file mode 100644 index 000000000000..e4a281c90ea8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the create_target_site call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site. +# +def create_target_site + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new + + # Call the create_target_site method. + result = client.create_target_site request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb new file mode 100644 index 000000000000..c1c309f33676 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_sitemap call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap. +# +def delete_sitemap + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new + + # Call the delete_sitemap method. + result = client.delete_sitemap request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb new file mode 100644 index 000000000000..9fe17da161ec --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the delete_target_site call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site. +# +def delete_target_site + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new + + # Call the delete_target_site method. + result = client.delete_target_site request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb new file mode 100644 index 000000000000..89b9cfb78997 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the disable_advanced_site_search call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search. +# +def disable_advanced_site_search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new + + # Call the disable_advanced_site_search method. + result = client.disable_advanced_site_search request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb new file mode 100644 index 000000000000..2ba8a6a76192 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the enable_advanced_site_search call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search. +# +def enable_advanced_site_search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new + + # Call the enable_advanced_site_search method. + result = client.enable_advanced_site_search request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb new file mode 100644 index 000000000000..a184d8259d7d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the fetch_domain_verification_status call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status. +# +def fetch_domain_verification_status + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new + + # Call the fetch_domain_verification_status method. + result = client.fetch_domain_verification_status request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + p item + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb new file mode 100644 index 000000000000..a7a736ef6cd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the fetch_sitemaps call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps. +# +def fetch_sitemaps + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new + + # Call the fetch_sitemaps method. + result = client.fetch_sitemaps request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. + p result +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb new file mode 100644 index 000000000000..576aae43eefc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_site_search_engine call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine. +# +def get_site_search_engine + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new + + # Call the get_site_search_engine method. + result = client.get_site_search_engine request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. + p result +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb new file mode 100644 index 000000000000..691157f6171a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the get_target_site call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site. +# +def get_target_site + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new + + # Call the get_target_site method. + result = client.get_target_site request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. + p result +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb new file mode 100644 index 000000000000..5b166d63dfbf --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_target_sites call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites. +# +def list_target_sites + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new + + # Call the list_target_sites method. + result = client.list_target_sites request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. + p item + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb new file mode 100644 index 000000000000..ef6d692d5af0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the recrawl_uris call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris. +# +def recrawl_uris + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new + + # Call the recrawl_uris method. + result = client.recrawl_uris request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb new file mode 100644 index 000000000000..47b5006c002c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the update_target_site call in the SiteSearchEngineService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site. +# +def update_target_site + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new + + # Call the update_target_site method. + result = client.update_target_site request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json new file mode 100644 index 000000000000..be976f34aae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json @@ -0,0 +1,3855 @@ +{ + "client_library": { + "name": "google-cloud-discovery_engine-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.discoveryengine.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "discoveryengine_v1_generated_SearchService_Search_sync", + "title": "Snippet for the search call in the SearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search.", + "file": "search_service/search.rb", + "language": "RUBY", + "client_method": { + "short_name": "search", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::SearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::SearchResponse", + "client": { + "short_name": "SearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client" + }, + "method": { + "short_name": "Search", + "full_name": "google.cloud.discoveryengine.v1.SearchService.Search", + "service": { + "short_name": "SearchService", + "full_name": "google.cloud.discoveryengine.v1.SearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SearchService_SearchLite_sync", + "title": "Snippet for the search_lite call in the SearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite.", + "file": "search_service/search_lite.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_lite", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::SearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::SearchResponse", + "client": { + "short_name": "SearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client" + }, + "method": { + "short_name": "SearchLite", + "full_name": "google.cloud.discoveryengine.v1.SearchService.SearchLite", + "service": { + "short_name": "SearchService", + "full_name": "google.cloud.discoveryengine.v1.SearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_AssistantService_StreamAssist_sync", + "title": "Snippet for the stream_assist call in the AssistantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist.", + "file": "assistant_service/stream_assist.rb", + "language": "RUBY", + "client_method": { + "short_name": "stream_assist", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse", + "client": { + "short_name": "AssistantService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client" + }, + "method": { + "short_name": "StreamAssist", + "full_name": "google.cloud.discoveryengine.v1.AssistantService.StreamAssist", + "service": { + "short_name": "AssistantService", + "full_name": "google.cloud.discoveryengine.v1.AssistantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync", + "title": "Snippet for the update_cmek_config call in the CmekConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config.", + "file": "cmek_config_service/update_cmek_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cmek_config", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CmekConfigService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" + }, + "method": { + "short_name": "UpdateCmekConfig", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.UpdateCmekConfig", + "service": { + "short_name": "CmekConfigService", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync", + "title": "Snippet for the get_cmek_config call in the CmekConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config.", + "file": "cmek_config_service/get_cmek_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cmek_config", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::CmekConfig", + "client": { + "short_name": "CmekConfigService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" + }, + "method": { + "short_name": "GetCmekConfig", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.GetCmekConfig", + "service": { + "short_name": "CmekConfigService", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync", + "title": "Snippet for the list_cmek_configs call in the CmekConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs.", + "file": "cmek_config_service/list_cmek_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_cmek_configs", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse", + "client": { + "short_name": "CmekConfigService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" + }, + "method": { + "short_name": "ListCmekConfigs", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.ListCmekConfigs", + "service": { + "short_name": "CmekConfigService", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync", + "title": "Snippet for the delete_cmek_config call in the CmekConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config.", + "file": "cmek_config_service/delete_cmek_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cmek_config", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CmekConfigService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" + }, + "method": { + "short_name": "DeleteCmekConfig", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.DeleteCmekConfig", + "service": { + "short_name": "CmekConfigService", + "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CompletionService_CompleteQuery_sync", + "title": "Snippet for the complete_query call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query.", + "file": "completion_service/complete_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_query", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" + }, + "method": { + "short_name": "CompleteQuery", + "full_name": "google.cloud.discoveryengine.v1.CompletionService.CompleteQuery", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.discoveryengine.v1.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync", + "title": "Snippet for the import_suggestion_deny_list_entries call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries.", + "file": "completion_service/import_suggestion_deny_list_entries.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_suggestion_deny_list_entries", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" + }, + "method": { + "short_name": "ImportSuggestionDenyListEntries", + "full_name": "google.cloud.discoveryengine.v1.CompletionService.ImportSuggestionDenyListEntries", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.discoveryengine.v1.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync", + "title": "Snippet for the purge_suggestion_deny_list_entries call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries.", + "file": "completion_service/purge_suggestion_deny_list_entries.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_suggestion_deny_list_entries", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" + }, + "method": { + "short_name": "PurgeSuggestionDenyListEntries", + "full_name": "google.cloud.discoveryengine.v1.CompletionService.PurgeSuggestionDenyListEntries", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.discoveryengine.v1.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync", + "title": "Snippet for the import_completion_suggestions call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions.", + "file": "completion_service/import_completion_suggestions.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_completion_suggestions", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" + }, + "method": { + "short_name": "ImportCompletionSuggestions", + "full_name": "google.cloud.discoveryengine.v1.CompletionService.ImportCompletionSuggestions", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.discoveryengine.v1.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync", + "title": "Snippet for the purge_completion_suggestions call in the CompletionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions.", + "file": "completion_service/purge_completion_suggestions.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_completion_suggestions", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CompletionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" + }, + "method": { + "short_name": "PurgeCompletionSuggestions", + "full_name": "google.cloud.discoveryengine.v1.CompletionService.PurgeCompletionSuggestions", + "service": { + "short_name": "CompletionService", + "full_name": "google.cloud.discoveryengine.v1.CompletionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ControlService_CreateControl_sync", + "title": "Snippet for the create_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control.", + "file": "control_service/create_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_control", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" + }, + "method": { + "short_name": "CreateControl", + "full_name": "google.cloud.discoveryengine.v1.ControlService.CreateControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.discoveryengine.v1.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ControlService_DeleteControl_sync", + "title": "Snippet for the delete_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control.", + "file": "control_service/delete_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_control", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" + }, + "method": { + "short_name": "DeleteControl", + "full_name": "google.cloud.discoveryengine.v1.ControlService.DeleteControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.discoveryengine.v1.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ControlService_UpdateControl_sync", + "title": "Snippet for the update_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control.", + "file": "control_service/update_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_control", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" + }, + "method": { + "short_name": "UpdateControl", + "full_name": "google.cloud.discoveryengine.v1.ControlService.UpdateControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.discoveryengine.v1.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ControlService_GetControl_sync", + "title": "Snippet for the get_control call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control.", + "file": "control_service/get_control.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_control", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetControlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" + }, + "method": { + "short_name": "GetControl", + "full_name": "google.cloud.discoveryengine.v1.ControlService.GetControl", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.discoveryengine.v1.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ControlService_ListControls_sync", + "title": "Snippet for the list_controls call in the ControlService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls.", + "file": "control_service/list_controls.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_controls", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse", + "client": { + "short_name": "ControlService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" + }, + "method": { + "short_name": "ListControls", + "full_name": "google.cloud.discoveryengine.v1.ControlService.ListControls", + "service": { + "short_name": "ControlService", + "full_name": "google.cloud.discoveryengine.v1.ControlService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync", + "title": "Snippet for the converse_conversation call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation.", + "file": "conversational_search_service/converse_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "converse_conversation", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "ConverseConversation", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync", + "title": "Snippet for the create_conversation call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation.", + "file": "conversational_search_service/create_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "CreateConversation", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.CreateConversation", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync", + "title": "Snippet for the delete_conversation call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation.", + "file": "conversational_search_service/delete_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_conversation", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "DeleteConversation", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.DeleteConversation", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync", + "title": "Snippet for the update_conversation call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation.", + "file": "conversational_search_service/update_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_conversation", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "UpdateConversation", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.UpdateConversation", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync", + "title": "Snippet for the get_conversation call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation.", + "file": "conversational_search_service/get_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "GetConversation", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetConversation", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync", + "title": "Snippet for the list_conversations call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations.", + "file": "conversational_search_service/list_conversations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversations", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "ListConversations", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ListConversations", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync", + "title": "Snippet for the answer_query call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query.", + "file": "conversational_search_service/answer_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "answer_query", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "AnswerQuery", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.AnswerQuery", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync", + "title": "Snippet for the stream_answer_query call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query.", + "file": "conversational_search_service/stream_answer_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "stream_answer_query", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "StreamAnswerQuery", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.StreamAnswerQuery", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 49, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync", + "title": "Snippet for the get_answer call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer.", + "file": "conversational_search_service/get_answer.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_answer", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Answer", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "GetAnswer", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync", + "title": "Snippet for the create_session call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session.", + "file": "conversational_search_service/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.CreateSession", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync", + "title": "Snippet for the delete_session call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session.", + "file": "conversational_search_service/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.DeleteSession", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync", + "title": "Snippet for the update_session call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session.", + "file": "conversational_search_service/update_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "UpdateSession", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.UpdateSession", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync", + "title": "Snippet for the get_session call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session.", + "file": "conversational_search_service/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync", + "title": "Snippet for the list_sessions call in the ConversationalSearchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions.", + "file": "conversational_search_service/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse", + "client": { + "short_name": "ConversationalSearchService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ListSessions", + "service": { + "short_name": "ConversationalSearchService", + "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync", + "title": "Snippet for the create_data_store call in the DataStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store.", + "file": "data_store_service/create_data_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_data_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DataStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" + }, + "method": { + "short_name": "CreateDataStore", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService.CreateDataStore", + "service": { + "short_name": "DataStoreService", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DataStoreService_GetDataStore_sync", + "title": "Snippet for the get_data_store call in the DataStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store.", + "file": "data_store_service/get_data_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_data_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::DataStore", + "client": { + "short_name": "DataStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" + }, + "method": { + "short_name": "GetDataStore", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService.GetDataStore", + "service": { + "short_name": "DataStoreService", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DataStoreService_ListDataStores_sync", + "title": "Snippet for the list_data_stores call in the DataStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores.", + "file": "data_store_service/list_data_stores.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_data_stores", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse", + "client": { + "short_name": "DataStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" + }, + "method": { + "short_name": "ListDataStores", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService.ListDataStores", + "service": { + "short_name": "DataStoreService", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync", + "title": "Snippet for the delete_data_store call in the DataStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store.", + "file": "data_store_service/delete_data_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_data_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DataStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" + }, + "method": { + "short_name": "DeleteDataStore", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService.DeleteDataStore", + "service": { + "short_name": "DataStoreService", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync", + "title": "Snippet for the update_data_store call in the DataStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store.", + "file": "data_store_service/update_data_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_data_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::DataStore", + "client": { + "short_name": "DataStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" + }, + "method": { + "short_name": "UpdateDataStore", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService.UpdateDataStore", + "service": { + "short_name": "DataStoreService", + "full_name": "google.cloud.discoveryengine.v1.DataStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_GetDocument_sync", + "title": "Snippet for the get_document call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document.", + "file": "document_service/get_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_document", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "GetDocument", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.GetDocument", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_ListDocuments_sync", + "title": "Snippet for the list_documents call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents.", + "file": "document_service/list_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_documents", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "ListDocuments", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.ListDocuments", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_CreateDocument_sync", + "title": "Snippet for the create_document call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document.", + "file": "document_service/create_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_document", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "CreateDocument", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.CreateDocument", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_UpdateDocument_sync", + "title": "Snippet for the update_document call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document.", + "file": "document_service/update_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_document", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "UpdateDocument", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.UpdateDocument", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_DeleteDocument_sync", + "title": "Snippet for the delete_document call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document.", + "file": "document_service/delete_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_document", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "DeleteDocument", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.DeleteDocument", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_ImportDocuments_sync", + "title": "Snippet for the import_documents call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents.", + "file": "document_service/import_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_documents", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "ImportDocuments", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.ImportDocuments", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync", + "title": "Snippet for the purge_documents call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents.", + "file": "document_service/purge_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_documents", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "PurgeDocuments", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync", + "title": "Snippet for the batch_get_documents_metadata call in the DocumentService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata.", + "file": "document_service/batch_get_documents_metadata.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_get_documents_metadata", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse", + "client": { + "short_name": "DocumentService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" + }, + "method": { + "short_name": "BatchGetDocumentsMetadata", + "full_name": "google.cloud.discoveryengine.v1.DocumentService.BatchGetDocumentsMetadata", + "service": { + "short_name": "DocumentService", + "full_name": "google.cloud.discoveryengine.v1.DocumentService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_EngineService_CreateEngine_sync", + "title": "Snippet for the create_engine call in the EngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine.", + "file": "engine_service/create_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_engine", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" + }, + "method": { + "short_name": "CreateEngine", + "full_name": "google.cloud.discoveryengine.v1.EngineService.CreateEngine", + "service": { + "short_name": "EngineService", + "full_name": "google.cloud.discoveryengine.v1.EngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_EngineService_DeleteEngine_sync", + "title": "Snippet for the delete_engine call in the EngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine.", + "file": "engine_service/delete_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_engine", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" + }, + "method": { + "short_name": "DeleteEngine", + "full_name": "google.cloud.discoveryengine.v1.EngineService.DeleteEngine", + "service": { + "short_name": "EngineService", + "full_name": "google.cloud.discoveryengine.v1.EngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_EngineService_UpdateEngine_sync", + "title": "Snippet for the update_engine call in the EngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine.", + "file": "engine_service/update_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_engine", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Engine", + "client": { + "short_name": "EngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" + }, + "method": { + "short_name": "UpdateEngine", + "full_name": "google.cloud.discoveryengine.v1.EngineService.UpdateEngine", + "service": { + "short_name": "EngineService", + "full_name": "google.cloud.discoveryengine.v1.EngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_EngineService_GetEngine_sync", + "title": "Snippet for the get_engine call in the EngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine.", + "file": "engine_service/get_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_engine", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Engine", + "client": { + "short_name": "EngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" + }, + "method": { + "short_name": "GetEngine", + "full_name": "google.cloud.discoveryengine.v1.EngineService.GetEngine", + "service": { + "short_name": "EngineService", + "full_name": "google.cloud.discoveryengine.v1.EngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_EngineService_ListEngines_sync", + "title": "Snippet for the list_engines call in the EngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines.", + "file": "engine_service/list_engines.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_engines", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse", + "client": { + "short_name": "EngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" + }, + "method": { + "short_name": "ListEngines", + "full_name": "google.cloud.discoveryengine.v1.EngineService.ListEngines", + "service": { + "short_name": "EngineService", + "full_name": "google.cloud.discoveryengine.v1.EngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync", + "title": "Snippet for the stream_generate_grounded_content call in the GroundedGenerationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content.", + "file": "grounded_generation_service/stream_generate_grounded_content.rb", + "language": "RUBY", + "client_method": { + "short_name": "stream_generate_grounded_content", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse", + "client": { + "short_name": "GroundedGenerationService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" + }, + "method": { + "short_name": "StreamGenerateGroundedContent", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.StreamGenerateGroundedContent", + "service": { + "short_name": "GroundedGenerationService", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync", + "title": "Snippet for the generate_grounded_content call in the GroundedGenerationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content.", + "file": "grounded_generation_service/generate_grounded_content.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_grounded_content", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse", + "client": { + "short_name": "GroundedGenerationService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" + }, + "method": { + "short_name": "GenerateGroundedContent", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.GenerateGroundedContent", + "service": { + "short_name": "GroundedGenerationService", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync", + "title": "Snippet for the check_grounding call in the GroundedGenerationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding.", + "file": "grounded_generation_service/check_grounding.rb", + "language": "RUBY", + "client_method": { + "short_name": "check_grounding", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse", + "client": { + "short_name": "GroundedGenerationService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" + }, + "method": { + "short_name": "CheckGrounding", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.CheckGrounding", + "service": { + "short_name": "GroundedGenerationService", + "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync", + "title": "Snippet for the create_identity_mapping_store call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store.", + "file": "identity_mapping_store_service/create_identity_mapping_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_identity_mapping_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "CreateIdentityMappingStore", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.CreateIdentityMappingStore", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync", + "title": "Snippet for the get_identity_mapping_store call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store.", + "file": "identity_mapping_store_service/get_identity_mapping_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_identity_mapping_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "GetIdentityMappingStore", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.GetIdentityMappingStore", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync", + "title": "Snippet for the delete_identity_mapping_store call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store.", + "file": "identity_mapping_store_service/delete_identity_mapping_store.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_identity_mapping_store", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "DeleteIdentityMappingStore", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.DeleteIdentityMappingStore", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync", + "title": "Snippet for the import_identity_mappings call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings.", + "file": "identity_mapping_store_service/import_identity_mappings.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_identity_mappings", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "ImportIdentityMappings", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ImportIdentityMappings", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync", + "title": "Snippet for the purge_identity_mappings call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings.", + "file": "identity_mapping_store_service/purge_identity_mappings.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_identity_mappings", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "PurgeIdentityMappings", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.PurgeIdentityMappings", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync", + "title": "Snippet for the list_identity_mappings call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings.", + "file": "identity_mapping_store_service/list_identity_mappings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_identity_mappings", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "ListIdentityMappings", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ListIdentityMappings", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync", + "title": "Snippet for the list_identity_mapping_stores call in the IdentityMappingStoreService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores.", + "file": "identity_mapping_store_service/list_identity_mapping_stores.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_identity_mapping_stores", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse", + "client": { + "short_name": "IdentityMappingStoreService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" + }, + "method": { + "short_name": "ListIdentityMappingStores", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ListIdentityMappingStores", + "service": { + "short_name": "IdentityMappingStoreService", + "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ProjectService_ProvisionProject_sync", + "title": "Snippet for the provision_project call in the ProjectService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project.", + "file": "project_service/provision_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "provision_project", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProjectService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client" + }, + "method": { + "short_name": "ProvisionProject", + "full_name": "google.cloud.discoveryengine.v1.ProjectService.ProvisionProject", + "service": { + "short_name": "ProjectService", + "full_name": "google.cloud.discoveryengine.v1.ProjectService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_RankService_Rank_sync", + "title": "Snippet for the rank call in the RankService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank.", + "file": "rank_service/rank.rb", + "language": "RUBY", + "client_method": { + "short_name": "rank", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::RankRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::RankResponse", + "client": { + "short_name": "RankService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client" + }, + "method": { + "short_name": "Rank", + "full_name": "google.cloud.discoveryengine.v1.RankService.Rank", + "service": { + "short_name": "RankService", + "full_name": "google.cloud.discoveryengine.v1.RankService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_RecommendationService_Recommend_sync", + "title": "Snippet for the recommend call in the RecommendationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend.", + "file": "recommendation_service/recommend.rb", + "language": "RUBY", + "client_method": { + "short_name": "recommend", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::RecommendRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::RecommendResponse", + "client": { + "short_name": "RecommendationService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client" + }, + "method": { + "short_name": "Recommend", + "full_name": "google.cloud.discoveryengine.v1.RecommendationService.Recommend", + "service": { + "short_name": "RecommendationService", + "full_name": "google.cloud.discoveryengine.v1.RecommendationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SchemaService_GetSchema_sync", + "title": "Snippet for the get_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema.", + "file": "schema_service/get_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_schema", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Schema", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" + }, + "method": { + "short_name": "GetSchema", + "full_name": "google.cloud.discoveryengine.v1.SchemaService.GetSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.cloud.discoveryengine.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SchemaService_ListSchemas_sync", + "title": "Snippet for the list_schemas call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas.", + "file": "schema_service/list_schemas.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_schemas", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" + }, + "method": { + "short_name": "ListSchemas", + "full_name": "google.cloud.discoveryengine.v1.SchemaService.ListSchemas", + "service": { + "short_name": "SchemaService", + "full_name": "google.cloud.discoveryengine.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SchemaService_CreateSchema_sync", + "title": "Snippet for the create_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema.", + "file": "schema_service/create_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_schema", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" + }, + "method": { + "short_name": "CreateSchema", + "full_name": "google.cloud.discoveryengine.v1.SchemaService.CreateSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.cloud.discoveryengine.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SchemaService_UpdateSchema_sync", + "title": "Snippet for the update_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema.", + "file": "schema_service/update_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_schema", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" + }, + "method": { + "short_name": "UpdateSchema", + "full_name": "google.cloud.discoveryengine.v1.SchemaService.UpdateSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.cloud.discoveryengine.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SchemaService_DeleteSchema_sync", + "title": "Snippet for the delete_schema call in the SchemaService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema.", + "file": "schema_service/delete_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_schema", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SchemaService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" + }, + "method": { + "short_name": "DeleteSchema", + "full_name": "google.cloud.discoveryengine.v1.SchemaService.DeleteSchema", + "service": { + "short_name": "SchemaService", + "full_name": "google.cloud.discoveryengine.v1.SchemaService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync", + "title": "Snippet for the train_custom_model call in the SearchTuningService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model.", + "file": "search_tuning_service/train_custom_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_custom_model", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SearchTuningService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client" + }, + "method": { + "short_name": "TrainCustomModel", + "full_name": "google.cloud.discoveryengine.v1.SearchTuningService.TrainCustomModel", + "service": { + "short_name": "SearchTuningService", + "full_name": "google.cloud.discoveryengine.v1.SearchTuningService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync", + "title": "Snippet for the list_custom_models call in the SearchTuningService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models.", + "file": "search_tuning_service/list_custom_models.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_models", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse", + "client": { + "short_name": "SearchTuningService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client" + }, + "method": { + "short_name": "ListCustomModels", + "full_name": "google.cloud.discoveryengine.v1.SearchTuningService.ListCustomModels", + "service": { + "short_name": "SearchTuningService", + "full_name": "google.cloud.discoveryengine.v1.SearchTuningService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync", + "title": "Snippet for the update_serving_config call in the ServingConfigService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config.", + "file": "serving_config_service/update_serving_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_serving_config", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ServingConfig", + "client": { + "short_name": "ServingConfigService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client" + }, + "method": { + "short_name": "UpdateServingConfig", + "full_name": "google.cloud.discoveryengine.v1.ServingConfigService.UpdateServingConfig", + "service": { + "short_name": "ServingConfigService", + "full_name": "google.cloud.discoveryengine.v1.ServingConfigService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SessionService_CreateSession_sync", + "title": "Snippet for the create_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session.", + "file": "session_service/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.cloud.discoveryengine.v1.SessionService.CreateSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.discoveryengine.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SessionService_DeleteSession_sync", + "title": "Snippet for the delete_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session.", + "file": "session_service/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.cloud.discoveryengine.v1.SessionService.DeleteSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.discoveryengine.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SessionService_UpdateSession_sync", + "title": "Snippet for the update_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session.", + "file": "session_service/update_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" + }, + "method": { + "short_name": "UpdateSession", + "full_name": "google.cloud.discoveryengine.v1.SessionService.UpdateSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.discoveryengine.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SessionService_GetSession_sync", + "title": "Snippet for the get_session call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session.", + "file": "session_service/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.cloud.discoveryengine.v1.SessionService.GetSession", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.discoveryengine.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SessionService_ListSessions_sync", + "title": "Snippet for the list_sessions call in the SessionService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions.", + "file": "session_service/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse", + "client": { + "short_name": "SessionService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.cloud.discoveryengine.v1.SessionService.ListSessions", + "service": { + "short_name": "SessionService", + "full_name": "google.cloud.discoveryengine.v1.SessionService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync", + "title": "Snippet for the get_site_search_engine call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine.", + "file": "site_search_engine_service/get_site_search_engine.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_site_search_engine", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "GetSiteSearchEngine", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.GetSiteSearchEngine", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync", + "title": "Snippet for the create_target_site call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site.", + "file": "site_search_engine_service/create_target_site.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_target_site", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "CreateTargetSite", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.CreateTargetSite", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync", + "title": "Snippet for the batch_create_target_sites call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites.", + "file": "site_search_engine_service/batch_create_target_sites.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_target_sites", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "BatchCreateTargetSites", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.BatchCreateTargetSites", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync", + "title": "Snippet for the get_target_site call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site.", + "file": "site_search_engine_service/get_target_site.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_target_site", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::TargetSite", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "GetTargetSite", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.GetTargetSite", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync", + "title": "Snippet for the update_target_site call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site.", + "file": "site_search_engine_service/update_target_site.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_target_site", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "UpdateTargetSite", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.UpdateTargetSite", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync", + "title": "Snippet for the delete_target_site call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site.", + "file": "site_search_engine_service/delete_target_site.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_target_site", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "DeleteTargetSite", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DeleteTargetSite", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync", + "title": "Snippet for the list_target_sites call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites.", + "file": "site_search_engine_service/list_target_sites.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_target_sites", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "ListTargetSites", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.ListTargetSites", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync", + "title": "Snippet for the create_sitemap call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap.", + "file": "site_search_engine_service/create_sitemap.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_sitemap", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "CreateSitemap", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.CreateSitemap", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync", + "title": "Snippet for the delete_sitemap call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap.", + "file": "site_search_engine_service/delete_sitemap.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_sitemap", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "DeleteSitemap", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DeleteSitemap", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync", + "title": "Snippet for the fetch_sitemaps call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps.", + "file": "site_search_engine_service/fetch_sitemaps.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_sitemaps", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "FetchSitemaps", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.FetchSitemaps", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync", + "title": "Snippet for the enable_advanced_site_search call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search.", + "file": "site_search_engine_service/enable_advanced_site_search.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_advanced_site_search", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "EnableAdvancedSiteSearch", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.EnableAdvancedSiteSearch", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync", + "title": "Snippet for the disable_advanced_site_search call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search.", + "file": "site_search_engine_service/disable_advanced_site_search.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_advanced_site_search", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "DisableAdvancedSiteSearch", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DisableAdvancedSiteSearch", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync", + "title": "Snippet for the recrawl_uris call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris.", + "file": "site_search_engine_service/recrawl_uris.rb", + "language": "RUBY", + "client_method": { + "short_name": "recrawl_uris", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "RecrawlUris", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.RecrawlUris", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync", + "title": "Snippet for the batch_verify_target_sites call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites.", + "file": "site_search_engine_service/batch_verify_target_sites.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_verify_target_sites", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "BatchVerifyTargetSites", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.BatchVerifyTargetSites", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync", + "title": "Snippet for the fetch_domain_verification_status call in the SiteSearchEngineService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status.", + "file": "site_search_engine_service/fetch_domain_verification_status.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_domain_verification_status", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse", + "client": { + "short_name": "SiteSearchEngineService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" + }, + "method": { + "short_name": "FetchDomainVerificationStatus", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.FetchDomainVerificationStatus", + "service": { + "short_name": "SiteSearchEngineService", + "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync", + "title": "Snippet for the write_user_event call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event.", + "file": "user_event_service/write_user_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "write_user_event", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::UserEvent", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" + }, + "method": { + "short_name": "WriteUserEvent", + "full_name": "google.cloud.discoveryengine.v1.UserEventService.WriteUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.discoveryengine.v1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync", + "title": "Snippet for the collect_user_event call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event.", + "file": "user_event_service/collect_user_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "collect_user_event", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Api::HttpBody", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" + }, + "method": { + "short_name": "CollectUserEvent", + "full_name": "google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.discoveryengine.v1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync", + "title": "Snippet for the purge_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events.", + "file": "user_event_service/purge_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_user_events", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" + }, + "method": { + "short_name": "PurgeUserEvents", + "full_name": "google.cloud.discoveryengine.v1.UserEventService.PurgeUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.discoveryengine.v1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync", + "title": "Snippet for the import_user_events call in the UserEventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events.", + "file": "user_event_service/import_user_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_user_events", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserEventService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" + }, + "method": { + "short_name": "ImportUserEvents", + "full_name": "google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents", + "service": { + "short_name": "UserEventService", + "full_name": "google.cloud.discoveryengine.v1.UserEventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync", + "title": "Snippet for the list_user_licenses call in the UserLicenseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses.", + "file": "user_license_service/list_user_licenses.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_user_licenses", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse", + "client": { + "short_name": "UserLicenseService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client" + }, + "method": { + "short_name": "ListUserLicenses", + "full_name": "google.cloud.discoveryengine.v1.UserLicenseService.ListUserLicenses", + "service": { + "short_name": "UserLicenseService", + "full_name": "google.cloud.discoveryengine.v1.UserLicenseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync", + "title": "Snippet for the batch_update_user_licenses call in the UserLicenseService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses.", + "file": "user_license_service/batch_update_user_licenses.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_user_licenses", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "UserLicenseService::Client", + "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client" + }, + "method": { + "short_name": "BatchUpdateUserLicenses", + "full_name": "google.cloud.discoveryengine.v1.UserLicenseService.BatchUpdateUserLicenses", + "service": { + "short_name": "UserLicenseService", + "full_name": "google.cloud.discoveryengine.v1.UserLicenseService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb new file mode 100644 index 000000000000..d389c637b58d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the collect_user_event call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event. +# +def collect_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new + + # Call the collect_user_event method. + result = client.collect_user_event request + + # The returned object is of type Google::Api::HttpBody. + p result +end +# [END discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb new file mode 100644 index 000000000000..b36bd414b229 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the import_user_events call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events. +# +def import_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new + + # Call the import_user_events method. + result = client.import_user_events request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb new file mode 100644 index 000000000000..25da932780cb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the purge_user_events call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events. +# +def purge_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new + + # Call the purge_user_events method. + result = client.purge_user_events request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb new file mode 100644 index 000000000000..bfef48ec7efc --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the write_user_event call in the UserEventService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event. +# +def write_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new + + # Call the write_user_event method. + result = client.write_user_event request + + # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. + p result +end +# [END discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb new file mode 100644 index 000000000000..71ab81e2aea0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the batch_update_user_licenses call in the UserLicenseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses. +# +def batch_update_user_licenses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new + + # Call the batch_update_user_licenses method. + result = client.batch_update_user_licenses request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb new file mode 100644 index 000000000000..f2f1bd9358bd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync] +require "google/cloud/discovery_engine/v1" + +## +# Snippet for the list_user_licenses call in the UserLicenseService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses. +# +def list_user_licenses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new + + # Call the list_user_licenses method. + result = client.list_user_licenses request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. + p item + end +end +# [END discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb new file mode 100644 index 000000000000..68a5da979595 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/assistant_service" + +class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_assistant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assistant_path project: "value0", location: "value1", collection: "value2", engine: "value3", assistant: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/assistants/value4", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb new file mode 100644 index 000000000000..f90cc7c364f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/assistant_service_pb" +require "google/cloud/discovery_engine/v1/assistant_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_stream_assist + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + query = {} + session = "hello world" + user_metadata = {} + tools_spec = {} + generation_spec = {} + + stream_assist_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ServiceStub.stub :transcode_stream_assist_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stream_assist_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.stream_assist name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.stream_assist ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.stream_assist(::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, stream_assist_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb new file mode 100644 index 000000000000..86795293888e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/assistant_service_pb" +require "google/cloud/discovery_engine/v1/assistant_service" + +class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_stream_assist + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + name = "hello world" + query = {} + session = "hello world" + user_metadata = {} + tools_spec = {} + generation_spec = {} + + stream_assist_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :stream_assist, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata), request["user_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec), request["tools_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec), request["generation_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stream_assist_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stream_assist name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stream_assist ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stream_assist(::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, stream_assist_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb new file mode 100644 index 000000000000..1ccd248038e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" +require "google/cloud/discoveryengine/v1/cmek_config_service_services_pb" +require "google/cloud/discovery_engine/v1/cmek_config_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb new file mode 100644 index 000000000000..0d066a121995 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/cmek_config_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_cmek_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cmek_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/cmekConfig", path + + path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" + assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path + end + end + + def test_crypto_key_versions_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_crypto_keys_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb new file mode 100644 index 000000000000..5e51e0881317 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb @@ -0,0 +1,316 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" +require "google/cloud/discovery_engine/v1/cmek_config_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_cmek_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + config = {} + set_default = true + + update_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_update_cmek_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cmek_config({ config: config, set_default: set_default }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cmek_config config: config, set_default: set_default do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cmek_config ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cmek_config({ config: config, set_default: set_default }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cmek_config(::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cmek_config_client_stub.call_count + end + end + end + + def test_get_cmek_config + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_get_cmek_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cmek_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cmek_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cmek_config ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cmek_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cmek_config(::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cmek_config_client_stub.call_count + end + end + end + + def test_list_cmek_configs + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_cmek_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_list_cmek_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_cmek_configs_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_cmek_configs({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_cmek_configs parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_cmek_configs ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_cmek_configs({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_cmek_configs(::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_cmek_configs_client_stub.call_count + end + end + end + + def test_delete_cmek_config + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_delete_cmek_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cmek_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cmek_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cmek_config ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cmek_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cmek_config(::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cmek_config_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb new file mode 100644 index 000000000000..31bbc58df373 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb @@ -0,0 +1,362 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/cmek_config_service_pb" +require "google/cloud/discovery_engine/v1/cmek_config_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_cmek_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + config = {} + set_default = true + + update_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cmek_config, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::CmekConfig), request["config"] + assert_equal true, request["set_default"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cmek_config({ config: config, set_default: set_default }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cmek_config config: config, set_default: set_default do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cmek_config ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cmek_config({ config: config, set_default: set_default }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cmek_config(::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cmek_config_client_stub.call_rpc_count + end + end + + def test_get_cmek_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cmek_config, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cmek_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cmek_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cmek_config ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cmek_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cmek_config(::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cmek_config_client_stub.call_rpc_count + end + end + + def test_list_cmek_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_cmek_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_cmek_configs, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_cmek_configs_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_cmek_configs({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_cmek_configs parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_cmek_configs ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_cmek_configs({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_cmek_configs(::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_cmek_configs_client_stub.call_rpc_count + end + end + + def test_delete_cmek_config + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cmek_config, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cmek_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cmek_config({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cmek_config name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cmek_config ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cmek_config({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cmek_config(::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cmek_config_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb new file mode 100644 index 000000000000..f27e79b51f36 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/completion_service_pb" +require "google/cloud/discoveryengine/v1/completion_service_services_pb" +require "google/cloud/discovery_engine/v1/completion_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb new file mode 100644 index 000000000000..b37649623cc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/completion_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb new file mode 100644 index 000000000000..a53895abee84 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/completion_service_pb" +require "google/cloud/discovery_engine/v1/completion_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + data_store = "hello world" + query = "hello world" + query_model = "hello world" + user_pseudo_id = "hello world" + include_tail_suggestions = true + + complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_query data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_query ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_count + end + end + end + + def test_import_suggestion_deny_list_entries + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + + import_suggestion_deny_list_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_import_suggestion_deny_list_entries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_suggestion_deny_list_entries_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_suggestion_deny_list_entries inline_source: inline_source, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_suggestion_deny_list_entries_client_stub.call_count + end + end + end + + def test_purge_suggestion_deny_list_entries + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + purge_suggestion_deny_list_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_purge_suggestion_deny_list_entries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_suggestion_deny_list_entries_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_suggestion_deny_list_entries({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_suggestion_deny_list_entries parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_suggestion_deny_list_entries({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_suggestion_deny_list_entries_client_stub.call_count + end + end + end + + def test_import_completion_suggestions + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + + import_completion_suggestions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_import_completion_suggestions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_completion_suggestions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_completion_suggestions inline_source: inline_source, parent: parent, error_config: error_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_completion_suggestions_client_stub.call_count + end + end + end + + def test_purge_completion_suggestions + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + purge_completion_suggestions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_purge_completion_suggestions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_completion_suggestions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_completion_suggestions({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_completion_suggestions parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_completion_suggestions({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_completion_suggestions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb new file mode 100644 index 000000000000..bdd0cb013cde --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/completion_service_pb" +require "google/cloud/discovery_engine/v1/completion_service" + +class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + data_store = "hello world" + query = "hello world" + query_model = "hello world" + user_pseudo_id = "hello world" + include_tail_suggestions = true + + complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_query, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, request + assert_equal "hello world", request["data_store"] + assert_equal "hello world", request["query"] + assert_equal "hello world", request["query_model"] + assert_equal "hello world", request["user_pseudo_id"] + assert_equal true, request["include_tail_suggestions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_query data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_query ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_query_client_stub.call_rpc_count + end + end + + def test_import_suggestion_deny_list_entries + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + + import_suggestion_deny_list_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_suggestion_deny_list_entries, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_suggestion_deny_list_entries_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_suggestion_deny_list_entries inline_source: inline_source, parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_suggestion_deny_list_entries_client_stub.call_rpc_count + end + end + + def test_purge_suggestion_deny_list_entries + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + purge_suggestion_deny_list_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_suggestion_deny_list_entries, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_suggestion_deny_list_entries_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_suggestion_deny_list_entries({ parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_suggestion_deny_list_entries parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_suggestion_deny_list_entries({ parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, purge_suggestion_deny_list_entries_client_stub.call_rpc_count + end + end + + def test_import_completion_suggestions + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + + import_completion_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_completion_suggestions, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_completion_suggestions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_completion_suggestions inline_source: inline_source, parent: parent, error_config: error_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_completion_suggestions_client_stub.call_rpc_count + end + end + + def test_purge_completion_suggestions + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + purge_completion_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_completion_suggestions, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_completion_suggestions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_completion_suggestions({ parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_completion_suggestions parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_completion_suggestions({ parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, purge_completion_suggestions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb new file mode 100644 index 000000000000..778825d28d06 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/control_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ControlService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_control_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.control_path project: "value0", location: "value1", data_store: "value2", control: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/controls/value3", path + + path = client.control_path project: "value0", location: "value1", collection: "value2", data_store: "value3", control: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/controls/value4", path + + path = client.control_path project: "value0", location: "value1", collection: "value2", engine: "value3", control: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/controls/value4", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb new file mode 100644 index 000000000000..6eb9f920087c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/control_service_pb" +require "google/cloud/discovery_engine/v1/control_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_control + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + control = {} + control_id = "hello world" + + create_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_create_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_control({ parent: parent, control: control, control_id: control_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_control parent: parent, control: control, control_id: control_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_control ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_control({ parent: parent, control: control, control_id: control_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_control(::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_control_client_stub.call_count + end + end + end + + def test_delete_control + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_delete_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_control({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_control name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_control ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_control({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_control(::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_control_client_stub.call_count + end + end + end + + def test_update_control + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + control = {} + update_mask = {} + + update_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_update_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_control({ control: control, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_control control: control, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_control ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_control({ control: control, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_control(::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_control_client_stub.call_count + end + end + end + + def test_get_control + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_get_control_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_control({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_control name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_control ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_control({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_control(::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_control_client_stub.call_count + end + end + end + + def test_list_controls + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_controls_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_list_controls_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_controls_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_controls parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_controls ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_controls(::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_controls_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb new file mode 100644 index 000000000000..5a0fdd64487c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb @@ -0,0 +1,411 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/control_service_pb" +require "google/cloud/discovery_engine/v1/control_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ControlService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + control = {} + control_id = "hello world" + + create_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_control, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Control), request["control"] + assert_equal "hello world", request["control_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_control({ parent: parent, control: control, control_id: control_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_control parent: parent, control: control, control_id: control_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_control ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_control({ parent: parent, control: control, control_id: control_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_control(::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_control_client_stub.call_rpc_count + end + end + + def test_delete_control + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_control, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_control({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_control name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_control ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_control({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_control(::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_control_client_stub.call_rpc_count + end + end + + def test_update_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + control = {} + update_mask = {} + + update_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_control, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Control), request["control"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_control({ control: control, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_control control: control, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_control ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_control({ control: control, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_control(::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_control_client_stub.call_rpc_count + end + end + + def test_get_control + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_control, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_control_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_control({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_control name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_control ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_control({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_control(::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_control_client_stub.call_rpc_count + end + end + + def test_list_controls + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_controls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_controls, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_controls_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_controls parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_controls ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_controls(::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_controls_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb new file mode 100644 index 000000000000..c7e15d3b262e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/conversational_search_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_answer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.answer_path project: "value0", location: "value1", data_store: "value2", session: "value3", answer: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3/answers/value4", path + + path = client.answer_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4", answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4/answers/value5", path + + path = client.answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/answers/value5", path + end + end + + def test_assist_answer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assist_answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", assist_answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/assistAnswers/value5", path + end + end + + def test_chunk_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.chunk_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4", chunk: "value5" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4/chunks/value5", path + + path = client.chunk_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5", chunk: "value6" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5/chunks/value6", path + end + end + + def test_conversation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_path project: "value0", location: "value1", data_store: "value2", conversation: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/conversations/value3", path + + path = client.conversation_path project: "value0", location: "value1", collection: "value2", data_store: "value3", conversation: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/conversations/value4", path + + path = client.conversation_path project: "value0", location: "value1", collection: "value2", engine: "value3", conversation: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/conversations/value4", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb new file mode 100644 index 000000000000..de1b4d8b81ed --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb @@ -0,0 +1,900 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/conversational_search_service_pb" +require "google/cloud/discovery_engine/v1/conversational_search_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_converse_conversation + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + query = {} + serving_config = "hello world" + conversation = {} + safe_search = true + user_labels = {} + summary_spec = {} + filter = "hello world" + boost_spec = {} + + converse_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_converse_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, converse_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.converse_conversation name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.converse_conversation ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.converse_conversation(::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, converse_conversation_client_stub.call_count + end + end + end + + def test_create_conversation + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + conversation = {} + + create_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_create_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_conversation({ parent: parent, conversation: conversation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_conversation parent: parent, conversation: conversation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_conversation ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_conversation({ parent: parent, conversation: conversation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_conversation(::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_conversation_client_stub.call_count + end + end + end + + def test_delete_conversation + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_delete_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_conversation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_conversation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_conversation ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_conversation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_conversation(::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_conversation_client_stub.call_count + end + end + end + + def test_update_conversation + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + conversation = {} + update_mask = {} + + update_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_update_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_conversation({ conversation: conversation, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_conversation conversation: conversation, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_conversation ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_conversation({ conversation: conversation, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_conversation(::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_conversation_client_stub.call_count + end + end + end + + def test_get_conversation + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_conversation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_conversation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_conversation ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_conversation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_conversation(::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_conversation_client_stub.call_count + end + end + end + + def test_list_conversations + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_conversations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_list_conversations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_conversations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_conversations ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_conversations(::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_conversations_client_stub.call_count + end + end + end + + def test_answer_query + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + query = {} + session = "hello world" + safety_spec = {} + related_questions_spec = {} + grounding_spec = {} + answer_generation_spec = {} + search_spec = {} + query_understanding_spec = {} + asynchronous_mode = true + user_pseudo_id = "hello world" + user_labels = {} + end_user_spec = {} + + answer_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_answer_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, answer_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, answer_query_client_stub.call_count + end + end + end + + def test_stream_answer_query + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + query = {} + session = "hello world" + safety_spec = {} + related_questions_spec = {} + grounding_spec = {} + answer_generation_spec = {} + search_spec = {} + query_understanding_spec = {} + asynchronous_mode = true + user_pseudo_id = "hello world" + user_labels = {} + end_user_spec = {} + + stream_answer_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_stream_answer_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stream_answer_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use named arguments + client.stream_answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object + client.stream_answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use hash object with options + client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Use protobuf object with options + client.stream_answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end.first + + # Verify method calls + assert_equal 5, stream_answer_query_client_stub.call_count + end + end + end + + def test_get_answer + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Answer.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_answer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_answer_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_answer_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_answer({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_answer name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_answer ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_answer({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_answer(::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_answer_client_stub.call_count + end + end + end + + def test_create_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + + create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_session({ parent: parent, session: session }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_session parent: parent, session: session do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_session({ parent: parent, session: session }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_count + end + end + end + + def test_delete_session + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_count + end + end + end + + def test_update_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session = {} + update_mask = {} + + update_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_update_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_count + end + end + end + + def test_get_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + include_answer_details = true + + get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session({ name: name, include_answer_details: include_answer_details }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session name: name, include_answer_details: include_answer_details do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session({ name: name, include_answer_details: include_answer_details }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_count + end + end + end + + def test_list_sessions + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb new file mode 100644 index 000000000000..b108183f701b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb @@ -0,0 +1,1031 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/conversational_search_service_pb" +require "google/cloud/discovery_engine/v1/conversational_search_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_converse_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + query = {} + serving_config = "hello world" + conversation = {} + safe_search = true + user_labels = {} + summary_spec = {} + filter = "hello world" + boost_spec = {} + + converse_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :converse_conversation, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TextInput), request["query"] + assert_equal "hello world", request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] + assert_equal true, request["safe_search"] + assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec), request["summary_spec"] + assert_equal "hello world", request["filter"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, converse_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.converse_conversation name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.converse_conversation ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.converse_conversation(::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, converse_conversation_client_stub.call_rpc_count + end + end + + def test_create_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + conversation = {} + + create_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_conversation({ parent: parent, conversation: conversation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_conversation parent: parent, conversation: conversation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_conversation ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_conversation({ parent: parent, conversation: conversation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_conversation(::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_conversation_client_stub.call_rpc_count + end + end + + def test_delete_conversation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_conversation, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_conversation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_conversation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_conversation ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_conversation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_conversation(::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_conversation_client_stub.call_rpc_count + end + end + + def test_update_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + conversation = {} + update_mask = {} + + update_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_conversation, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_conversation({ conversation: conversation, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_conversation conversation: conversation, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_conversation ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_conversation({ conversation: conversation, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_conversation(::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_conversation_client_stub.call_rpc_count + end + end + + def test_get_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_conversation, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_conversation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_conversation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_conversation ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_conversation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_conversation(::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_conversation_client_stub.call_rpc_count + end + end + + def test_list_conversations + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_conversations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversations, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_conversations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_conversations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_conversations ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_conversations(::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_conversations_client_stub.call_rpc_count + end + end + + def test_answer_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + query = {} + session = "hello world" + safety_spec = {} + related_questions_spec = {} + grounding_spec = {} + answer_generation_spec = {} + search_spec = {} + query_understanding_spec = {} + asynchronous_mode = true + user_pseudo_id = "hello world" + user_labels = {} + end_user_spec = {} + + answer_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :answer_query, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec), request["safety_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec), request["related_questions_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec), request["grounding_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec), request["answer_generation_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec), request["search_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec), request["query_understanding_spec"] + assert_equal true, request["asynchronous_mode"] + assert_equal "hello world", request["user_pseudo_id"] + assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec), request["end_user_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, answer_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, answer_query_client_stub.call_rpc_count + end + end + + def test_stream_answer_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a server streaming method. + serving_config = "hello world" + query = {} + session = "hello world" + safety_spec = {} + related_questions_spec = {} + grounding_spec = {} + answer_generation_spec = {} + search_spec = {} + query_understanding_spec = {} + asynchronous_mode = true + user_pseudo_id = "hello world" + user_labels = {} + end_user_spec = {} + + stream_answer_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :stream_answer_query, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec), request["safety_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec), request["related_questions_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec), request["grounding_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec), request["answer_generation_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec), request["search_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec), request["query_understanding_spec"] + assert_equal true, request["asynchronous_mode"] + assert_equal "hello world", request["user_pseudo_id"] + assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec), request["end_user_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stream_answer_query_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stream_answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stream_answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stream_answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), grpc_options) do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r + end + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, stream_answer_query_client_stub.call_rpc_count + end + end + + def test_get_answer + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Answer.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_answer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_answer, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_answer_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_answer({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_answer name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_answer ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_answer({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_answer(::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_answer_client_stub.call_rpc_count + end + end + + def test_create_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ parent: parent, session: session }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session parent: parent, session: session do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session({ parent: parent, session: session }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_rpc_count + end + end + + def test_delete_session + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_rpc_count + end + end + + def test_update_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = {} + update_mask = {} + + update_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + include_answer_details = true + + get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["include_answer_details"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name, include_answer_details: include_answer_details }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name, include_answer_details: include_answer_details do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ name: name, include_answer_details: include_answer_details }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb new file mode 100644 index 000000000000..cf6034bc47f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/data_store_service_pb" +require "google/cloud/discoveryengine/v1/data_store_service_services_pb" +require "google/cloud/discovery_engine/v1/data_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb new file mode 100644 index 000000000000..0f78cdf60586 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/data_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_cmek_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cmek_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/cmekConfig", path + + path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" + assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path + end + end + + def test_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.collection_path project: "value0", location: "value1", collection: "value2" + assert_equal "projects/value0/locations/value1/collections/value2", path + end + end + + def test_crypto_key_versions_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_crypto_keys_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_processing_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_processing_config_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2/documentProcessingConfig", path + + path = client.document_processing_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/documentProcessingConfig", path + end + end + + def test_identity_mapping_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.identity_mapping_store_path project: "value0", location: "value1", identity_mapping_store: "value2" + assert_equal "projects/value0/locations/value1/identityMappingStores/value2", path + end + end + + def test_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.schema_path project: "value0", location: "value1", data_store: "value2", schema: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/schemas/value3", path + + path = client.schema_path project: "value0", location: "value1", collection: "value2", data_store: "value3", schema: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/schemas/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb new file mode 100644 index 000000000000..873fb9a4a439 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb @@ -0,0 +1,378 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/data_store_service_pb" +require "google/cloud/discovery_engine/v1/data_store_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_data_store + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + cmek_config_name = "hello world" + parent = "hello world" + data_store = {} + data_store_id = "hello world" + create_advanced_site_search = true + skip_default_schema_creation = true + + create_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_create_data_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_data_store cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_data_store ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_data_store(::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_data_store_client_stub.call_count + end + end + end + + def test_get_data_store + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_get_data_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_data_store({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_data_store name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_data_store ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_data_store({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_data_store(::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_data_store_client_stub.call_count + end + end + end + + def test_list_data_stores + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_data_stores_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_list_data_stores_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_data_stores_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_data_stores parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_data_stores ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_data_stores(::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_data_stores_client_stub.call_count + end + end + end + + def test_delete_data_store + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_delete_data_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_data_store({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_data_store name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_data_store ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_data_store({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_data_store(::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_data_store_client_stub.call_count + end + end + end + + def test_update_data_store + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + data_store = {} + update_mask = {} + + update_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_update_data_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_data_store({ data_store: data_store, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_data_store data_store: data_store, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_data_store ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_data_store({ data_store: data_store, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_data_store(::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_data_store_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb new file mode 100644 index 000000000000..280024bc29a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/data_store_service_pb" +require "google/cloud/discovery_engine/v1/data_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_data_store + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + cmek_config_name = "hello world" + parent = "hello world" + data_store = {} + data_store_id = "hello world" + create_advanced_site_search = true + skip_default_schema_creation = true + + create_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_data_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, request + assert_equal "hello world", request["cmek_config_name"] + assert_equal :cmek_config_name, request.cmek_options + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::DataStore), request["data_store"] + assert_equal "hello world", request["data_store_id"] + assert_equal true, request["create_advanced_site_search"] + assert_equal true, request["skip_default_schema_creation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_data_store cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_data_store ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_data_store(::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_data_store_client_stub.call_rpc_count + end + end + + def test_get_data_store + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_data_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_data_store({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_data_store name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_data_store ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_data_store({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_data_store(::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_data_store_client_stub.call_rpc_count + end + end + + def test_list_data_stores + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_data_stores_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_data_stores, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_data_stores_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_data_stores parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_data_stores ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_data_stores(::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_data_stores_client_stub.call_rpc_count + end + end + + def test_delete_data_store + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_data_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_data_store({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_data_store name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_data_store ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_data_store({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_data_store(::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_data_store_client_stub.call_rpc_count + end + end + + def test_update_data_store + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + data_store = {} + update_mask = {} + + update_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_data_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::DataStore), request["data_store"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_data_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_data_store({ data_store: data_store, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_data_store data_store: data_store, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_data_store ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_data_store({ data_store: data_store, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_data_store(::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_data_store_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb new file mode 100644 index 000000000000..a73e23fc74cb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/document_service_pb" +require "google/cloud/discoveryengine/v1/document_service_services_pb" +require "google/cloud/discovery_engine/v1/document_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb new file mode 100644 index 000000000000..c41403c25931 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/document_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", data_store: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3", path + + path = client.branch_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_fhir_resource_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.fhir_resource_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3", resource_type: "value4", fhir_resource_id: "value5" + assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3/fhir/value4/value5", path + end + end + + def test_fhir_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.fhir_store_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3" + assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb new file mode 100644 index 000000000000..540b53eef8e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb @@ -0,0 +1,549 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/document_service_pb" +require "google/cloud/discovery_engine/v1/document_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_document + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_document({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_document name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_document ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_document({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_count + end + end + end + + def test_list_documents + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_documents parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_documents ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_documents(::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_documents_client_stub.call_count + end + end + end + + def test_create_document + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + document = {} + document_id = "hello world" + + create_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_document({ parent: parent, document: document, document_id: document_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_document parent: parent, document: document, document_id: document_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_document ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_document({ parent: parent, document: document, document_id: document_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_document(::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_document_client_stub.call_count + end + end + end + + def test_update_document + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + document = {} + allow_missing = true + update_mask = {} + + update_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_document document: document, allow_missing: allow_missing, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_document ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_document(::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_document_client_stub.call_count + end + end + end + + def test_delete_document + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_document({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_document name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_document ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_document({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_document(::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_document_client_stub.call_count + end + end + end + + def test_import_documents + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED + update_mask = {} + auto_generate_ids = true + id_field = "hello world" + force_refresh_content = true + + import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_documents inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_documents ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_documents(::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_documents_client_stub.call_count + end + end + end + + def test_purge_documents + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_source = {} + parent = "hello world" + filter = "hello world" + error_config = {} + force = true + + purge_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_purge_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_documents gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_documents ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_documents(::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_documents_client_stub.call_count + end + end + end + + def test_batch_get_documents_metadata + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + matcher = {} + + batch_get_documents_metadata_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_batch_get_documents_metadata_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_get_documents_metadata_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_get_documents_metadata({ parent: parent, matcher: matcher }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_get_documents_metadata parent: parent, matcher: matcher do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_get_documents_metadata ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_get_documents_metadata({ parent: parent, matcher: matcher }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_get_documents_metadata(::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_get_documents_metadata_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb new file mode 100644 index 000000000000..5e63fcbdc4db --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb @@ -0,0 +1,635 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/document_service_pb" +require "google/cloud/discovery_engine/v1/document_service" + +class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_document, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_document({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_document name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_document ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_document({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_document(::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_document_client_stub.call_rpc_count + end + end + + def test_list_documents + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_documents, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_documents parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_documents ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_documents(::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_documents_client_stub.call_rpc_count + end + end + + def test_create_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + document = {} + document_id = "hello world" + + create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_document, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Document), request["document"] + assert_equal "hello world", request["document_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_document({ parent: parent, document: document, document_id: document_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_document parent: parent, document: document, document_id: document_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_document ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_document({ parent: parent, document: document, document_id: document_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_document(::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_document_client_stub.call_rpc_count + end + end + + def test_update_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + document = {} + allow_missing = true + update_mask = {} + + update_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_document, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Document), request["document"] + assert_equal true, request["allow_missing"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_document document: document, allow_missing: allow_missing, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_document ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_document(::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_document_client_stub.call_rpc_count + end + end + + def test_delete_document + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_document, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_document_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_document({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_document name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_document ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_document({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_document(::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_document_client_stub.call_rpc_count + end + end + + def test_import_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED + update_mask = {} + auto_generate_ids = true + id_field = "hello world" + force_refresh_content = true + + import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_documents, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] + assert_equal :RECONCILIATION_MODE_UNSPECIFIED, request["reconciliation_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["auto_generate_ids"] + assert_equal "hello world", request["id_field"] + assert_equal true, request["force_refresh_content"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_documents inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_documents ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_documents(::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_documents_client_stub.call_rpc_count + end + end + + def test_purge_documents + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_source = {} + parent = "hello world" + filter = "hello world" + error_config = {} + force = true + + purge_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_documents, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GcsSource), request["gcs_source"] + assert_equal :gcs_source, request.source + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig), request["error_config"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_documents_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_documents gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_documents ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_documents(::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, purge_documents_client_stub.call_rpc_count + end + end + + def test_batch_get_documents_metadata + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + matcher = {} + + batch_get_documents_metadata_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_get_documents_metadata, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher), request["matcher"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_get_documents_metadata_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_get_documents_metadata({ parent: parent, matcher: matcher }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_get_documents_metadata parent: parent, matcher: matcher do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_get_documents_metadata ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_get_documents_metadata({ parent: parent, matcher: matcher }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_get_documents_metadata(::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_get_documents_metadata_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb new file mode 100644 index 000000000000..3d1259a995e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/engine_service_pb" +require "google/cloud/discoveryengine/v1/engine_service_services_pb" +require "google/cloud/discovery_engine/v1/engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::EngineService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb new file mode 100644 index 000000000000..d7191894692d --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::EngineService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.collection_path project: "value0", location: "value1", collection: "value2" + assert_equal "projects/value0/locations/value1/collections/value2", path + end + end + + def test_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb new file mode 100644 index 000000000000..d4ec8b4977fb --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/engine_service_pb" +require "google/cloud/discovery_engine/v1/engine_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_engine + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + engine = {} + engine_id = "hello world" + + create_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_create_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_engine parent: parent, engine: engine, engine_id: engine_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_engine ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_engine(::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_engine_client_stub.call_count + end + end + end + + def test_delete_engine + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_delete_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_engine({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_engine name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_engine ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_engine({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_engine(::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_engine_client_stub.call_count + end + end + end + + def test_update_engine + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Engine.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + engine = {} + update_mask = {} + + update_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_update_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_engine({ engine: engine, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_engine engine: engine, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_engine ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_engine({ engine: engine, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_engine(::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_engine_client_stub.call_count + end + end + end + + def test_get_engine + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Engine.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_get_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_engine({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_engine name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_engine ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_engine({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_engine(::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_engine_client_stub.call_count + end + end + end + + def test_list_engines + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_engines_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_list_engines_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_engines_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_engines parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_engines ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_engines(::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_engines_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb new file mode 100644 index 000000000000..11c039f054ee --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/engine_service_pb" +require "google/cloud/discovery_engine/v1/engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::EngineService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_engine + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + engine = {} + engine_id = "hello world" + + create_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_engine, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Engine), request["engine"] + assert_equal "hello world", request["engine_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_engine parent: parent, engine: engine, engine_id: engine_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_engine ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_engine(::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_engine_client_stub.call_rpc_count + end + end + + def test_delete_engine + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_engine, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_engine({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_engine name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_engine ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_engine({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_engine(::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_engine_client_stub.call_rpc_count + end + end + + def test_update_engine + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Engine.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + engine = {} + update_mask = {} + + update_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_engine, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Engine), request["engine"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_engine({ engine: engine, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_engine engine: engine, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_engine ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_engine({ engine: engine, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_engine(::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_engine_client_stub.call_rpc_count + end + end + + def test_get_engine + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Engine.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_engine, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_engine({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_engine name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_engine ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_engine({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_engine(::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_engine_client_stub.call_rpc_count + end + end + + def test_list_engines + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_engines_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_engines, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_engines_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_engines parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_engines ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_engines(::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_engines_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb new file mode 100644 index 000000000000..c90837d6c3c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/grounded_generation_service" + +class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_grounding_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.grounding_config_path project: "value0", location: "value1", grounding_config: "value2" + assert_equal "projects/value0/locations/value1/groundingConfigs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb new file mode 100644 index 000000000000..240d3c729a65 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" +require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_generate_grounded_content + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + location = "hello world" + system_instruction = {} + contents = [{}] + generation_spec = {} + grounding_spec = {} + user_labels = {} + + generate_grounded_content_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.stub :transcode_generate_grounded_content_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_grounded_content_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_grounded_content location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_grounded_content ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_grounded_content(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_grounded_content_client_stub.call_count + end + end + end + + def test_check_grounding + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + grounding_config = "hello world" + answer_candidate = "hello world" + facts = [{}] + grounding_spec = {} + user_labels = {} + + check_grounding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.stub :transcode_check_grounding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, check_grounding_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.check_grounding grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.check_grounding ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.check_grounding(::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, check_grounding_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb new file mode 100644 index 000000000000..64883857ea17 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" +require "google/cloud/discovery_engine/v1/grounded_generation_service" + +class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_stream_generate_grounded_content + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + location = "hello world" + system_instruction = {} + contents = [{}] + generation_spec = {} + grounding_spec = {} + user_labels = {} + + stream_generate_grounded_content_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :stream_generate_grounded_content, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, stream_generate_grounded_content_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } + request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels + enum_input = [request_hash, request_proto].to_enum + client.stream_generate_grounded_content enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } + request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels + stream_input = Gapic::StreamInput.new + client.stream_generate_grounded_content stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } + request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels + enum_input = [request_hash, request_proto].to_enum + client.stream_generate_grounded_content enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } + request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels + stream_input = Gapic::StreamInput.new + client.stream_generate_grounded_content stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, stream_generate_grounded_content_client_stub.call_rpc_count + stream_generate_grounded_content_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, r + assert_equal "hello world", r["location"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent), r["system_instruction"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, r["contents"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec), r["generation_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec), r["grounding_spec"] + assert_equal({}, r["user_labels"].to_h) + end + end + end + end + + def test_generate_grounded_content + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + location = "hello world" + system_instruction = {} + contents = [{}] + generation_spec = {} + grounding_spec = {} + user_labels = {} + + generate_grounded_content_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_grounded_content, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, request + assert_equal "hello world", request["location"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent), request["system_instruction"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, request["contents"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec), request["generation_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec), request["grounding_spec"] + assert_equal({}, request["user_labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_grounded_content_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_grounded_content location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_grounded_content ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_grounded_content(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_grounded_content_client_stub.call_rpc_count + end + end + + def test_check_grounding + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + grounding_config = "hello world" + answer_candidate = "hello world" + facts = [{}] + grounding_spec = {} + user_labels = {} + + check_grounding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :check_grounding, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, request + assert_equal "hello world", request["grounding_config"] + assert_equal "hello world", request["answer_candidate"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundingFact, request["facts"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec), request["grounding_spec"] + assert_equal({}, request["user_labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, check_grounding_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.check_grounding grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.check_grounding ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.check_grounding(::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, check_grounding_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb new file mode 100644 index 000000000000..7ad6e0168f52 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb new file mode 100644 index 000000000000..edffe53b2961 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/identity_mapping_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_cmek_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cmek_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/cmekConfig", path + + path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" + assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path + end + end + + def test_crypto_key_versions_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_crypto_keys_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_identity_mapping_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.identity_mapping_store_path project: "value0", location: "value1", identity_mapping_store: "value2" + assert_equal "projects/value0/locations/value1/identityMappingStores/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb new file mode 100644 index 000000000000..3d502606805c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_identity_mapping_store + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + cmek_config_name = "hello world" + parent = "hello world" + identity_mapping_store_id = "hello world" + identity_mapping_store = {} + + create_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_create_identity_mapping_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_identity_mapping_store cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_identity_mapping_store_client_stub.call_count + end + end + end + + def test_get_identity_mapping_store + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_get_identity_mapping_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_identity_mapping_store({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_identity_mapping_store name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_identity_mapping_store({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_identity_mapping_store_client_stub.call_count + end + end + end + + def test_delete_identity_mapping_store + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_delete_identity_mapping_store_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_identity_mapping_store({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_identity_mapping_store name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_identity_mapping_store({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_identity_mapping_store_client_stub.call_count + end + end + end + + def test_import_identity_mappings + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + identity_mapping_store = "hello world" + + import_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_import_identity_mappings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_identity_mappings_client_stub.call_count + end + end + end + + def test_purge_identity_mappings + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + identity_mapping_store = "hello world" + filter = "hello world" + force = true + + purge_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_purge_identity_mappings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_identity_mappings_client_stub.call_count + end + end + end + + def test_list_identity_mappings + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + identity_mapping_store = "hello world" + page_size = 42 + page_token = "hello world" + + list_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_list_identity_mappings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_identity_mappings identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_identity_mappings_client_stub.call_count + end + end + end + + def test_list_identity_mapping_stores + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_identity_mapping_stores_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_list_identity_mapping_stores_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_identity_mapping_stores_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_identity_mapping_stores parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_identity_mapping_stores ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_identity_mapping_stores(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_identity_mapping_stores_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb new file mode 100644 index 000000000000..bb726435c20b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb @@ -0,0 +1,575 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" +require "google/cloud/discovery_engine/v1/identity_mapping_store_service" + +class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_identity_mapping_store + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + cmek_config_name = "hello world" + parent = "hello world" + identity_mapping_store_id = "hello world" + identity_mapping_store = {} + + create_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_identity_mapping_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, request + assert_equal "hello world", request["cmek_config_name"] + assert_equal :cmek_config_name, request.cmek_options + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["identity_mapping_store_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore), request["identity_mapping_store"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_identity_mapping_store cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_identity_mapping_store_client_stub.call_rpc_count + end + end + + def test_get_identity_mapping_store + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_identity_mapping_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_identity_mapping_store({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_identity_mapping_store name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_identity_mapping_store({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_identity_mapping_store_client_stub.call_rpc_count + end + end + + def test_delete_identity_mapping_store + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_identity_mapping_store, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_identity_mapping_store_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_identity_mapping_store({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_identity_mapping_store name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_identity_mapping_store({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_identity_mapping_store_client_stub.call_rpc_count + end + end + + def test_import_identity_mappings + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + identity_mapping_store = "hello world" + + import_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_identity_mappings, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["identity_mapping_store"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_identity_mappings_client_stub.call_rpc_count + end + end + + def test_purge_identity_mappings + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + identity_mapping_store = "hello world" + filter = "hello world" + force = true + + purge_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_identity_mappings, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["identity_mapping_store"] + assert_equal "hello world", request["filter"] + assert_equal true, request["force"] + assert request.has_force? + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, purge_identity_mappings_client_stub.call_rpc_count + end + end + + def test_list_identity_mappings + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + identity_mapping_store = "hello world" + page_size = 42 + page_token = "hello world" + + list_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_identity_mappings, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, request + assert_equal "hello world", request["identity_mapping_store"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_identity_mappings_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_identity_mappings identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_identity_mappings_client_stub.call_rpc_count + end + end + + def test_list_identity_mapping_stores + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_identity_mapping_stores_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_identity_mapping_stores, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_identity_mapping_stores_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_identity_mapping_stores parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_identity_mapping_stores ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_identity_mapping_stores(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_identity_mapping_stores_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb new file mode 100644 index 000000000000..df69bd75f2c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/project_service_pb" +require "google/cloud/discoveryengine/v1/project_service_services_pb" +require "google/cloud/discovery_engine/v1/project_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb new file mode 100644 index 000000000000..39fddcfd5006 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/project_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb new file mode 100644 index 000000000000..2d8a39a6494a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/project_service_pb" +require "google/cloud/discovery_engine/v1/project_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_provision_project + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + accept_data_use_terms = true + data_use_terms_version = "hello world" + + provision_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ServiceStub.stub :transcode_provision_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, provision_project_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.provision_project name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.provision_project ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.provision_project(::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, provision_project_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb new file mode 100644 index 000000000000..5f272179858c --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/project_service_pb" +require "google/cloud/discovery_engine/v1/project_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_provision_project + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + accept_data_use_terms = true + data_use_terms_version = "hello world" + + provision_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :provision_project, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["accept_data_use_terms"] + assert_equal "hello world", request["data_use_terms_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, provision_project_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.provision_project name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.provision_project ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.provision_project(::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, provision_project_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb new file mode 100644 index 000000000000..96f3663c3930 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/rank_service" + +class ::Google::Cloud::DiscoveryEngine::V1::RankService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_ranking_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ranking_config_path project: "value0", location: "value1", ranking_config: "value2" + assert_equal "projects/value0/locations/value1/rankingConfigs/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb new file mode 100644 index 000000000000..77760caccfda --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/rank_service_pb" +require "google/cloud/discovery_engine/v1/rank_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_rank + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + ranking_config = "hello world" + model = "hello world" + top_n = 42 + query = "hello world" + records = [{}] + ignore_record_details_in_response = true + user_labels = {} + + rank_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ServiceStub.stub :transcode_rank_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rank_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rank ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rank ::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rank(::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rank_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb new file mode 100644 index 000000000000..231550d4317b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/rank_service_pb" +require "google/cloud/discovery_engine/v1/rank_service" + +class ::Google::Cloud::DiscoveryEngine::V1::RankService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_rank + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + ranking_config = "hello world" + model = "hello world" + top_n = 42 + query = "hello world" + records = [{}] + ignore_record_details_in_response = true + user_labels = {} + + rank_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rank, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankRequest, request + assert_equal "hello world", request["ranking_config"] + assert_equal "hello world", request["model"] + assert_equal 42, request["top_n"] + assert_equal "hello world", request["query"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankingRecord, request["records"].first + assert_equal true, request["ignore_record_details_in_response"] + assert_equal({}, request["user_labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, rank_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rank ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rank ::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rank(::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rank_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb new file mode 100644 index 000000000000..50e65c9ff2e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/recommendation_service" + +class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb new file mode 100644 index 000000000000..a0d3952f0db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/recommendation_service_pb" +require "google/cloud/discovery_engine/v1/recommendation_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_recommend + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + user_event = {} + page_size = 42 + filter = "hello world" + validate_only = true + params = {} + user_labels = {} + + recommend_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ServiceStub.stub :transcode_recommend_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recommend_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recommend serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recommend ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recommend(::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recommend_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb new file mode 100644 index 000000000000..5516ae9fb16f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/recommendation_service_pb" +require "google/cloud/discovery_engine/v1/recommendation_service" + +class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_recommend + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + user_event = {} + page_size = 42 + filter = "hello world" + validate_only = true + params = {} + user_labels = {} + + recommend_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recommend, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserEvent), request["user_event"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["filter"] + assert_equal true, request["validate_only"] + assert_equal({}, request["params"].to_h) + assert_equal({}, request["user_labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, recommend_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recommend serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recommend ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recommend(::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recommend_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb new file mode 100644 index 000000000000..baade7c854c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/schema_service_pb" +require "google/cloud/discoveryengine/v1/schema_service_services_pb" +require "google/cloud/discovery_engine/v1/schema_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb new file mode 100644 index 000000000000..ad5915ba35ae --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/schema_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.schema_path project: "value0", location: "value1", data_store: "value2", schema: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/schemas/value3", path + + path = client.schema_path project: "value0", location: "value1", collection: "value2", data_store: "value3", schema: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/schemas/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb new file mode 100644 index 000000000000..4ca190ba8f3f --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/schema_service_pb" +require "google/cloud/discovery_engine/v1/schema_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_schema + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Schema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_get_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_schema({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_schema name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_schema ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_schema({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_schema(::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_schema_client_stub.call_count + end + end + end + + def test_list_schemas + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_schemas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_list_schemas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_schemas_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_schemas parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_schemas ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_schemas(::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_schemas_client_stub.call_count + end + end + end + + def test_create_schema + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + schema = {} + schema_id = "hello world" + + create_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_create_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_schema parent: parent, schema: schema, schema_id: schema_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_schema ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_schema(::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_schema_client_stub.call_count + end + end + end + + def test_update_schema + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + schema = {} + allow_missing = true + + update_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_update_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_schema({ schema: schema, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_schema schema: schema, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_schema ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_schema({ schema: schema, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_schema(::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_schema_client_stub.call_count + end + end + end + + def test_delete_schema + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_delete_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_schema({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_schema name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_schema ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_schema({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_schema(::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_schema_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb new file mode 100644 index 000000000000..38bc71d3a934 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/schema_service_pb" +require "google/cloud/discovery_engine/v1/schema_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Schema.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_schema, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_schema({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_schema name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_schema ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_schema({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_schema(::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_schema_client_stub.call_rpc_count + end + end + + def test_list_schemas + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_schemas, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_schemas_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_schemas parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_schemas ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_schemas(::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_schemas_client_stub.call_rpc_count + end + end + + def test_create_schema + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + schema = {} + schema_id = "hello world" + + create_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_schema, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Schema), request["schema"] + assert_equal "hello world", request["schema_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_schema parent: parent, schema: schema, schema_id: schema_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_schema ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_schema(::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_schema_client_stub.call_rpc_count + end + end + + def test_update_schema + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + schema = {} + allow_missing = true + + update_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_schema, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Schema), request["schema"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_schema({ schema: schema, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_schema schema: schema, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_schema ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_schema({ schema: schema, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_schema(::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_schema_client_stub.call_rpc_count + end + end + + def test_delete_schema + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_schema, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_schema_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_schema({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_schema name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_schema ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_schema({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_schema(::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_schema_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb new file mode 100644 index 000000000000..96f0dc940fb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/search_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SearchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_branch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.branch_path project: "value0", location: "value1", data_store: "value2", branch: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3", path + + path = client.branch_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb new file mode 100644 index 000000000000..ba40e49e7efa --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/search_service_pb" +require "google/cloud/discovery_engine/v1/search_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_search + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + image_query = {} + page_size = 42 + page_token = "hello world" + offset = 42 + one_box_page_size = 42 + data_store_specs = [{}] + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + user_info = {} + language_code = "hello world" + facet_specs = [{}] + boost_spec = {} + params = {} + query_expansion_spec = {} + spell_correction_spec = {} + user_pseudo_id = "hello world" + content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED + safe_search = true + user_labels = {} + natural_language_query_understanding_spec = {} + search_as_you_type_spec = {} + display_spec = {} + crowding_specs = [{}] + session = "hello world" + session_spec = {} + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + relevance_score_spec = {} + + search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.stub :transcode_search_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_client_stub.call_count + end + end + end + + def test_search_lite + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + image_query = {} + page_size = 42 + page_token = "hello world" + offset = 42 + one_box_page_size = 42 + data_store_specs = [{}] + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + user_info = {} + language_code = "hello world" + facet_specs = [{}] + boost_spec = {} + params = {} + query_expansion_spec = {} + spell_correction_spec = {} + user_pseudo_id = "hello world" + content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED + safe_search = true + user_labels = {} + natural_language_query_understanding_spec = {} + search_as_you_type_spec = {} + display_spec = {} + crowding_specs = [{}] + session = "hello world" + session_spec = {} + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + relevance_score_spec = {} + + search_lite_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.stub :transcode_search_lite_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_lite_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_lite_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb new file mode 100644 index 000000000000..204810c8eff0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb @@ -0,0 +1,362 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/search_service_pb" +require "google/cloud/discovery_engine/v1/search_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SearchService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_search + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + image_query = {} + page_size = 42 + page_token = "hello world" + offset = 42 + one_box_page_size = 42 + data_store_specs = [{}] + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + user_info = {} + language_code = "hello world" + facet_specs = [{}] + boost_spec = {} + params = {} + query_expansion_spec = {} + spell_correction_spec = {} + user_pseudo_id = "hello world" + content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED + safe_search = true + user_labels = {} + natural_language_query_understanding_spec = {} + search_as_you_type_spec = {} + display_spec = {} + crowding_specs = [{}] + session = "hello world" + session_spec = {} + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + relevance_score_spec = {} + + search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal "hello world", request["branch"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["page_categories"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["offset"] + assert_equal 42, request["one_box_page_size"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, request["data_store_specs"].first + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["canonical_filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserInfo), request["user_info"] + assert_equal "hello world", request["language_code"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, request["facet_specs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] + assert_equal({}, request["params"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] + assert_equal "hello world", request["user_pseudo_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] + assert_equal "hello world", request["ranking_expression"] + assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] + assert_equal true, request["safe_search"] + assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_client_stub.call_rpc_count + end + end + + def test_search_lite + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + serving_config = "hello world" + branch = "hello world" + query = "hello world" + page_categories = ["hello world"] + image_query = {} + page_size = 42 + page_token = "hello world" + offset = 42 + one_box_page_size = 42 + data_store_specs = [{}] + filter = "hello world" + canonical_filter = "hello world" + order_by = "hello world" + user_info = {} + language_code = "hello world" + facet_specs = [{}] + boost_spec = {} + params = {} + query_expansion_spec = {} + spell_correction_spec = {} + user_pseudo_id = "hello world" + content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED + safe_search = true + user_labels = {} + natural_language_query_understanding_spec = {} + search_as_you_type_spec = {} + display_spec = {} + crowding_specs = [{}] + session = "hello world" + session_spec = {} + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + relevance_score_spec = {} + + search_lite_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_lite, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, request + assert_equal "hello world", request["serving_config"] + assert_equal "hello world", request["branch"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["page_categories"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["offset"] + assert_equal 42, request["one_box_page_size"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, request["data_store_specs"].first + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["canonical_filter"] + assert_equal "hello world", request["order_by"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserInfo), request["user_info"] + assert_equal "hello world", request["language_code"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, request["facet_specs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] + assert_equal({}, request["params"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] + assert_equal "hello world", request["user_pseudo_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] + assert_equal "hello world", request["ranking_expression"] + assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] + assert_equal true, request["safe_search"] + assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_lite_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_lite_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb new file mode 100644 index 000000000000..15dcc93625a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" +require "google/cloud/discoveryengine/v1/search_tuning_service_services_pb" +require "google/cloud/discovery_engine/v1/search_tuning_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb new file mode 100644 index 000000000000..8973cd9b3a49 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/search_tuning_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb new file mode 100644 index 000000000000..b11219a791a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" +require "google/cloud/discovery_engine/v1/search_tuning_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_train_custom_model + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_training_input = {} + data_store = "hello world" + model_type = "hello world" + error_config = {} + model_id = "hello world" + + train_custom_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.stub :transcode_train_custom_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, train_custom_model_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.train_custom_model gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.train_custom_model ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.train_custom_model(::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, train_custom_model_client_stub.call_count + end + end + end + + def test_list_custom_models + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + data_store = "hello world" + + list_custom_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.stub :transcode_list_custom_models_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_models_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_custom_models({ data_store: data_store }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_custom_models data_store: data_store do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_custom_models ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_custom_models({ data_store: data_store }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_custom_models(::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_custom_models_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb new file mode 100644 index 000000000000..8add24b8de2a --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/search_tuning_service_pb" +require "google/cloud/discovery_engine/v1/search_tuning_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_train_custom_model + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_training_input = {} + data_store = "hello world" + model_type = "hello world" + error_config = {} + model_id = "hello world" + + train_custom_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_custom_model, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput), request["gcs_training_input"] + assert_equal :gcs_training_input, request.training_input + assert_equal "hello world", request["data_store"] + assert_equal "hello world", request["model_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] + assert_equal "hello world", request["model_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_custom_model_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.train_custom_model gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.train_custom_model ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.train_custom_model(::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, train_custom_model_client_stub.call_rpc_count + end + end + + def test_list_custom_models + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + data_store = "hello world" + + list_custom_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_models, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, request + assert_equal "hello world", request["data_store"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_custom_models_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_custom_models({ data_store: data_store }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_custom_models data_store: data_store do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_custom_models ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_custom_models({ data_store: data_store }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_custom_models(::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_custom_models_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb new file mode 100644 index 000000000000..63b6913d0e41 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/serving_config_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_serving_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path + + path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb new file mode 100644 index 000000000000..f382db848984 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/serving_config_service_pb" +require "google/cloud/discovery_engine/v1/serving_config_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_serving_config + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + serving_config = {} + update_mask = {} + + update_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ServiceStub.stub :transcode_update_serving_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_serving_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_serving_config serving_config: serving_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_serving_config ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_serving_config(::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_serving_config_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb new file mode 100644 index 000000000000..931396d357a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/serving_config_service_pb" +require "google/cloud/discovery_engine/v1/serving_config_service" + +class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_update_serving_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + serving_config = {} + update_mask = {} + + update_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_serving_config, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ServingConfig), request["serving_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_serving_config_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_serving_config serving_config: serving_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_serving_config ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_serving_config(::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_serving_config_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb new file mode 100644 index 000000000000..5ea2bf08ce22 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/session_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SessionService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_answer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.answer_path project: "value0", location: "value1", data_store: "value2", session: "value3", answer: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3/answers/value4", path + + path = client.answer_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4", answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4/answers/value5", path + + path = client.answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/answers/value5", path + end + end + + def test_assist_answer_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.assist_answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", assist_answer: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/assistAnswers/value5", path + end + end + + def test_chunk_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.chunk_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4", chunk: "value5" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4/chunks/value5", path + + path = client.chunk_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5", chunk: "value6" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5/chunks/value6", path + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path + + path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb new file mode 100644 index 000000000000..c2fecba4e0cd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/session_service_pb" +require "google/cloud/discovery_engine/v1/session_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + + create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_session({ parent: parent, session: session }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_session parent: parent, session: session do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_session({ parent: parent, session: session }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_count + end + end + end + + def test_delete_session + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_count + end + end + end + + def test_update_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session = {} + update_mask = {} + + update_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_update_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_count + end + end + end + + def test_get_session + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + include_answer_details = true + + get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session({ name: name, include_answer_details: include_answer_details }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session name: name, include_answer_details: include_answer_details do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session({ name: name, include_answer_details: include_answer_details }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_count + end + end + end + + def test_list_sessions + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb new file mode 100644 index 000000000000..379a15167a97 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb @@ -0,0 +1,413 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/session_service_pb" +require "google/cloud/discovery_engine/v1/session_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SessionService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ parent: parent, session: session }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session parent: parent, session: session do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session({ parent: parent, session: session }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_rpc_count + end + end + + def test_delete_session + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_rpc_count + end + end + + def test_update_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session = {} + update_mask = {} + + update_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_session({ session: session, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_session session: session, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_session({ session: session, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_session_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + include_answer_details = true + + get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["include_answer_details"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name, include_answer_details: include_answer_details }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name, include_answer_details: include_answer_details do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ name: name, include_answer_details: include_answer_details }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb new file mode 100644 index 000000000000..3633b0511b7e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" +require "google/cloud/discoveryengine/v1/site_search_engine_service_services_pb" +require "google/cloud/discovery_engine/v1/site_search_engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb new file mode 100644 index 000000000000..bb0f95a6902e --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/site_search_engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_site_search_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.site_search_engine_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine", path + + path = client.site_search_engine_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine", path + end + end + + def test_sitemap_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.sitemap_path project: "value0", location: "value1", data_store: "value2", sitemap: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine/sitemaps/value3", path + + path = client.sitemap_path project: "value0", location: "value1", collection: "value2", data_store: "value3", sitemap: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine/sitemaps/value4", path + end + end + + def test_target_site_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.target_site_path project: "value0", location: "value1", data_store: "value2", target_site: "value3" + assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine/targetSites/value3", path + + path = client.target_site_path project: "value0", location: "value1", collection: "value2", data_store: "value3", target_site: "value4" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine/targetSites/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb new file mode 100644 index 000000000000..d259bb6e0cd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb @@ -0,0 +1,919 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" +require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_site_search_engine + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_site_search_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_get_site_search_engine_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_site_search_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_site_search_engine({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_site_search_engine name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_site_search_engine ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_site_search_engine({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_site_search_engine(::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_site_search_engine_client_stub.call_count + end + end + end + + def test_create_target_site + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + target_site = {} + + create_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_create_target_site_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_target_site({ parent: parent, target_site: target_site }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_target_site parent: parent, target_site: target_site do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_target_site ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_target_site({ parent: parent, target_site: target_site }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_target_site(::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_target_site_client_stub.call_count + end + end + end + + def test_batch_create_target_sites + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = [{}] + + batch_create_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_batch_create_target_sites_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_target_sites({ parent: parent, requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_target_sites parent: parent, requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_target_sites({ parent: parent, requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_target_sites_client_stub.call_count + end + end + end + + def test_get_target_site + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_get_target_site_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_target_site({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_target_site name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_target_site ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_target_site({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_target_site(::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_target_site_client_stub.call_count + end + end + end + + def test_update_target_site + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + target_site = {} + + update_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_update_target_site_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_target_site({ target_site: target_site }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_target_site target_site: target_site do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_target_site ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_target_site({ target_site: target_site }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_target_site(::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_target_site_client_stub.call_count + end + end + end + + def test_delete_target_site + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_delete_target_site_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_target_site({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_target_site name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_target_site ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_target_site({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_target_site(::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_target_site_client_stub.call_count + end + end + end + + def test_list_target_sites + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_list_target_sites_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_target_sites parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_target_sites ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_target_sites(::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_target_sites_client_stub.call_count + end + end + end + + def test_create_sitemap + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + sitemap = {} + + create_sitemap_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_create_sitemap_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_sitemap_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_sitemap({ parent: parent, sitemap: sitemap }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_sitemap parent: parent, sitemap: sitemap do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_sitemap ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_sitemap({ parent: parent, sitemap: sitemap }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_sitemap(::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_sitemap_client_stub.call_count + end + end + end + + def test_delete_sitemap + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_sitemap_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_delete_sitemap_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_sitemap_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_sitemap({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_sitemap name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_sitemap ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_sitemap({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_sitemap(::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_sitemap_client_stub.call_count + end + end + end + + def test_fetch_sitemaps + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + matcher = {} + + fetch_sitemaps_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_fetch_sitemaps_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_sitemaps_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_sitemaps({ parent: parent, matcher: matcher }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_sitemaps parent: parent, matcher: matcher do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_sitemaps ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_sitemaps({ parent: parent, matcher: matcher }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_sitemaps(::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_sitemaps_client_stub.call_count + end + end + end + + def test_enable_advanced_site_search + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + + enable_advanced_site_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_enable_advanced_site_search_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_advanced_site_search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.enable_advanced_site_search({ site_search_engine: site_search_engine }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.enable_advanced_site_search site_search_engine: site_search_engine do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.enable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.enable_advanced_site_search({ site_search_engine: site_search_engine }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.enable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_advanced_site_search_client_stub.call_count + end + end + end + + def test_disable_advanced_site_search + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + + disable_advanced_site_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_disable_advanced_site_search_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_advanced_site_search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.disable_advanced_site_search({ site_search_engine: site_search_engine }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.disable_advanced_site_search site_search_engine: site_search_engine do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.disable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.disable_advanced_site_search({ site_search_engine: site_search_engine }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.disable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_advanced_site_search_client_stub.call_count + end + end + end + + def test_recrawl_uris + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + uris = ["hello world"] + site_credential = "hello world" + + recrawl_uris_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_recrawl_uris_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, recrawl_uris_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.recrawl_uris site_search_engine: site_search_engine, uris: uris, site_credential: site_credential do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.recrawl_uris ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.recrawl_uris(::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, recrawl_uris_client_stub.call_count + end + end + end + + def test_batch_verify_target_sites + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + batch_verify_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_batch_verify_target_sites_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_verify_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_verify_target_sites({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_verify_target_sites parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_verify_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_verify_target_sites({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_verify_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_verify_target_sites_client_stub.call_count + end + end + end + + def test_fetch_domain_verification_status + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + page_size = 42 + page_token = "hello world" + + fetch_domain_verification_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_fetch_domain_verification_status_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_domain_verification_status_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_domain_verification_status site_search_engine: site_search_engine, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_domain_verification_status ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_domain_verification_status(::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_domain_verification_status_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb new file mode 100644 index 000000000000..ddf9c8013405 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb @@ -0,0 +1,1068 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" +require "google/cloud/discovery_engine/v1/site_search_engine_service" + +class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_site_search_engine + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_site_search_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_site_search_engine, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_site_search_engine_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_site_search_engine({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_site_search_engine name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_site_search_engine ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_site_search_engine({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_site_search_engine(::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_site_search_engine_client_stub.call_rpc_count + end + end + + def test_create_target_site + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + target_site = {} + + create_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_target_site, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TargetSite), request["target_site"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_target_site({ parent: parent, target_site: target_site }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_target_site parent: parent, target_site: target_site do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_target_site ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_target_site({ parent: parent, target_site: target_site }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_target_site(::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_target_site_client_stub.call_rpc_count + end + end + + def test_batch_create_target_sites + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = [{}] + + batch_create_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_target_sites, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_target_sites({ parent: parent, requests: requests }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_create_target_sites parent: parent, requests: requests do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_create_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_create_target_sites({ parent: parent, requests: requests }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_create_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_create_target_sites_client_stub.call_rpc_count + end + end + + def test_get_target_site + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_target_site, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_target_site({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_target_site name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_target_site ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_target_site({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_target_site(::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_target_site_client_stub.call_rpc_count + end + end + + def test_update_target_site + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + target_site = {} + + update_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_target_site, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TargetSite), request["target_site"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_target_site({ target_site: target_site }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_target_site target_site: target_site do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_target_site ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_target_site({ target_site: target_site }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_target_site(::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_target_site_client_stub.call_rpc_count + end + end + + def test_delete_target_site + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_target_site, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_target_site_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_target_site({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_target_site name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_target_site ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_target_site({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_target_site(::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_target_site_client_stub.call_rpc_count + end + end + + def test_list_target_sites + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_target_sites, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_target_sites parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_target_sites ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_target_sites(::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_target_sites_client_stub.call_rpc_count + end + end + + def test_create_sitemap + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + sitemap = {} + + create_sitemap_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_sitemap, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Sitemap), request["sitemap"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_sitemap_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_sitemap({ parent: parent, sitemap: sitemap }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_sitemap parent: parent, sitemap: sitemap do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_sitemap ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_sitemap({ parent: parent, sitemap: sitemap }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_sitemap(::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_sitemap_client_stub.call_rpc_count + end + end + + def test_delete_sitemap + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_sitemap_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_sitemap, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_sitemap_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_sitemap({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_sitemap name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_sitemap ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_sitemap({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_sitemap(::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_sitemap_client_stub.call_rpc_count + end + end + + def test_fetch_sitemaps + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + matcher = {} + + fetch_sitemaps_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_sitemaps, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher), request["matcher"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_sitemaps_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_sitemaps({ parent: parent, matcher: matcher }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_sitemaps parent: parent, matcher: matcher do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_sitemaps ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_sitemaps({ parent: parent, matcher: matcher }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_sitemaps(::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_sitemaps_client_stub.call_rpc_count + end + end + + def test_enable_advanced_site_search + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + + enable_advanced_site_search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_advanced_site_search, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, request + assert_equal "hello world", request["site_search_engine"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_advanced_site_search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.enable_advanced_site_search({ site_search_engine: site_search_engine }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.enable_advanced_site_search site_search_engine: site_search_engine do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.enable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.enable_advanced_site_search({ site_search_engine: site_search_engine }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.enable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_advanced_site_search_client_stub.call_rpc_count + end + end + + def test_disable_advanced_site_search + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + + disable_advanced_site_search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_advanced_site_search, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, request + assert_equal "hello world", request["site_search_engine"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_advanced_site_search_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_advanced_site_search({ site_search_engine: site_search_engine }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_advanced_site_search site_search_engine: site_search_engine do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_advanced_site_search({ site_search_engine: site_search_engine }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.disable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_advanced_site_search_client_stub.call_rpc_count + end + end + + def test_recrawl_uris + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + uris = ["hello world"] + site_credential = "hello world" + + recrawl_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :recrawl_uris, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, request + assert_equal "hello world", request["site_search_engine"] + assert_equal ["hello world"], request["uris"] + assert_equal "hello world", request["site_credential"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, recrawl_uris_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.recrawl_uris site_search_engine: site_search_engine, uris: uris, site_credential: site_credential do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.recrawl_uris ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.recrawl_uris(::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, recrawl_uris_client_stub.call_rpc_count + end + end + + def test_batch_verify_target_sites + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + batch_verify_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_verify_target_sites, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_verify_target_sites_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_verify_target_sites({ parent: parent }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_verify_target_sites parent: parent do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_verify_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_verify_target_sites({ parent: parent }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_verify_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_verify_target_sites_client_stub.call_rpc_count + end + end + + def test_fetch_domain_verification_status + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + site_search_engine = "hello world" + page_size = 42 + page_token = "hello world" + + fetch_domain_verification_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_domain_verification_status, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, request + assert_equal "hello world", request["site_search_engine"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_domain_verification_status_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_domain_verification_status site_search_engine: site_search_engine, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_domain_verification_status ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_domain_verification_status(::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_domain_verification_status_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb new file mode 100644 index 000000000000..a55b3a9ae1fd --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/user_event_service_pb" +require "google/cloud/discoveryengine/v1/user_event_service_services_pb" +require "google/cloud/discovery_engine/v1/user_event_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb new file mode 100644 index 000000000000..de0c2e50d7c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/user_event_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_data_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", path + + path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path + end + end + + def test_document_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" + assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path + + path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" + assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path + end + end + + def test_engine_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" + assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb new file mode 100644 index 000000000000..5725b2104bb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb @@ -0,0 +1,324 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/user_event_service_pb" +require "google/cloud/discovery_engine/v1/user_event_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_write_user_event + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_event = {} + write_async = true + + write_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_write_user_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, write_user_event_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.write_user_event(::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, write_user_event_client_stub.call_count + end + end + end + + def test_collect_user_event + # Create test objects. + client_result = ::Google::Api::HttpBody.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + + collect_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_collect_user_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, collect_user_event_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.collect_user_event(::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, collect_user_event_client_stub.call_count + end + end + end + + def test_purge_user_events + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + force = true + + purge_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_purge_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_user_events_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_user_events({ parent: parent, filter: filter, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_user_events parent: parent, filter: filter, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_user_events ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_user_events({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_user_events(::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_user_events_client_stub.call_count + end + end + end + + def test_import_user_events + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + + import_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_import_user_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_user_events_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_user_events inline_source: inline_source, parent: parent, error_config: error_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_user_events ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_user_events(::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_user_events_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb new file mode 100644 index 000000000000..9b9fef582513 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb @@ -0,0 +1,382 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/user_event_service_pb" +require "google/cloud/discovery_engine/v1/user_event_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_write_user_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_event = {} + write_async = true + + write_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :write_user_event, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserEvent), request["user_event"] + assert request.has_user_event? + assert_equal true, request["write_async"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, write_user_event_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.write_user_event ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.write_user_event(::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, write_user_event_client_stub.call_rpc_count + end + end + + def test_collect_user_event + # Create GRPC objects. + grpc_response = ::Google::Api::HttpBody.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_event = "hello world" + uri = "hello world" + ets = 42 + + collect_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :collect_user_event, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["user_event"] + assert_equal "hello world", request["uri"] + assert request.has_uri? + assert_equal 42, request["ets"] + assert request.has_ets? + refute_nil options + end + + Gapic::ServiceStub.stub :new, collect_user_event_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.collect_user_event ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.collect_user_event(::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, collect_user_event_client_stub.call_rpc_count + end + end + + def test_purge_user_events + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + force = true + + purge_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_user_events, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_user_events_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_user_events({ parent: parent, filter: filter, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_user_events parent: parent, filter: filter, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_user_events ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_user_events({ parent: parent, filter: filter, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_user_events(::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, purge_user_events_client_stub.call_rpc_count + end + end + + def test_import_user_events + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + error_config = {} + + import_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_user_events, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_user_events_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_user_events inline_source: inline_source, parent: parent, error_config: error_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_user_events ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_user_events(::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_user_events_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb new file mode 100644 index 000000000000..dc57a0e01983 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/user_license_service_pb" +require "google/cloud/discoveryengine/v1/user_license_service_services_pb" +require "google/cloud/discovery_engine/v1/user_license_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb new file mode 100644 index 000000000000..c412d15b7536 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discovery_engine/v1/user_license_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_license_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.license_config_path project: "value0", location: "value1", license_config: "value2" + assert_equal "projects/value0/locations/value1/licenseConfigs/value2", path + end + end + + def test_user_store_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.user_store_path project: "value0", location: "value1", user_store: "value2" + assert_equal "projects/value0/locations/value1/userStores/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb new file mode 100644 index 000000000000..0c3a89010401 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/discoveryengine/v1/user_license_service_pb" +require "google/cloud/discovery_engine/v1/user_license_service/rest" + + +class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_user_licenses + # Create test objects. + client_result = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_user_licenses_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.stub :transcode_list_user_licenses_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_user_licenses_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_user_licenses parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_user_licenses ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_user_licenses(::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_user_licenses_client_stub.call_count + end + end + end + + def test_batch_update_user_licenses + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + delete_unassigned_user_licenses = true + + batch_update_user_licenses_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.stub :transcode_batch_update_user_licenses_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_user_licenses_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_update_user_licenses inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_update_user_licenses ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_update_user_licenses(::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_user_licenses_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb new file mode 100644 index 000000000000..91d51627621b --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb @@ -0,0 +1,255 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/discoveryengine/v1/user_license_service_pb" +require "google/cloud/discovery_engine/v1/user_license_service" + +class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_user_licenses + # Create GRPC objects. + grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_user_licenses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_user_licenses, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_user_licenses_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_user_licenses parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_user_licenses ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_user_licenses(::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_user_licenses_client_stub.call_rpc_count + end + end + + def test_batch_update_user_licenses + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + inline_source = {} + parent = "hello world" + delete_unassigned_user_licenses = true + + batch_update_user_licenses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_user_licenses, name + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource), request["inline_source"] + assert_equal :inline_source, request.source + assert_equal "hello world", request["parent"] + assert_equal true, request["delete_unassigned_user_licenses"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_user_licenses_client_stub do + # Create client + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_update_user_licenses inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_update_user_licenses ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_update_user_licenses(::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_update_user_licenses_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From d8feaa641e58e84712d2dbb1b60679282c45cf85 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 11 Feb 2026 03:10:17 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../v1/search_service/client.rb | 364 +- .../v1/search_service/rest/client.rb | 364 +- .../cloud/discoveryengine/v1/data_store_pb.rb | 4 +- .../discoveryengine/v1/search_service_pb.rb | 19 +- .../cloud/discoveryengine/v1/data_store.rb | 30 + .../discoveryengine/v1/search_service.rb | 576 ++- .../v1/search_service_rest_test.rb | 34 +- .../v1/search_service_test.rb | 48 +- .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-discovery_engine-v1/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-discovery_engine-v1/Gemfile | 11 - .../LICENSE.md | 201 - .../README.md | 153 - .../google-cloud-discovery_engine-v1/Rakefile | 169 - .../gapic_metadata.json | 678 --- .../google-cloud-discovery_engine-v1.gemspec | 29 - .../lib/google-cloud-discovery_engine-v1.rb | 21 - .../lib/google/cloud/discovery_engine/v1.rb | 65 - .../discovery_engine/v1/assistant_service.rb | 55 - .../v1/assistant_service/client.rb | 526 --- .../v1/assistant_service/credentials.rb | 47 - .../v1/assistant_service/paths.rb | 169 - .../v1/assistant_service/rest.rb | 52 - .../v1/assistant_service/rest/client.rb | 478 -- .../v1/assistant_service/rest/service_stub.rb | 137 - .../v1/cmek_config_service.rb | 56 - .../v1/cmek_config_service/client.rb | 820 ---- .../v1/cmek_config_service/credentials.rb | 47 - .../v1/cmek_config_service/operations.rb | 841 ---- .../v1/cmek_config_service/paths.rb | 135 - .../v1/cmek_config_service/rest.rb | 53 - .../v1/cmek_config_service/rest/client.rb | 749 ---- .../v1/cmek_config_service/rest/operations.rb | 1159 ----- .../cmek_config_service/rest/service_stub.rb | 341 -- .../discovery_engine/v1/completion_service.rb | 56 - .../v1/completion_service/client.rb | 1000 ----- .../v1/completion_service/credentials.rb | 47 - .../v1/completion_service/operations.rb | 841 ---- .../v1/completion_service/paths.rb | 78 - .../v1/completion_service/rest.rb | 53 - .../v1/completion_service/rest/client.rb | 922 ---- .../v1/completion_service/rest/operations.rb | 1159 ----- .../completion_service/rest/service_stub.rb | 429 -- .../discovery_engine/v1/control_service.rb | 58 - .../v1/control_service/client.rb | 922 ---- .../v1/control_service/credentials.rb | 47 - .../v1/control_service/paths.rb | 220 - .../v1/control_service/rest.rb | 55 - .../v1/control_service/rest/client.rb | 844 ---- .../v1/control_service/rest/service_stub.rb | 462 -- .../v1/conversational_search_service.rb | 55 - .../conversational_search_service/client.rb | 2026 --------- .../credentials.rb | 47 - .../v1/conversational_search_service/paths.rb | 491 --- .../v1/conversational_search_service/rest.rb | 52 - .../rest/client.rb | 1887 -------- .../rest/service_stub.rb | 1146 ----- .../discovery_engine/v1/data_store_service.rb | 57 - .../v1/data_store_service/client.rb | 1000 ----- .../v1/data_store_service/credentials.rb | 47 - .../v1/data_store_service/operations.rb | 841 ---- .../v1/data_store_service/paths.rb | 295 -- .../v1/data_store_service/rest.rb | 54 - .../v1/data_store_service/rest/client.rb | 922 ---- .../v1/data_store_service/rest/operations.rb | 1159 ----- .../data_store_service/rest/service_stub.rb | 425 -- .../discovery_engine/v1/document_service.rb | 57 - .../v1/document_service/client.rb | 1426 ------ .../v1/document_service/credentials.rb | 47 - .../v1/document_service/operations.rb | 841 ---- .../v1/document_service/paths.rb | 181 - .../v1/document_service/rest.rb | 54 - .../v1/document_service/rest/client.rb | 1327 ------ .../v1/document_service/rest/operations.rb | 1159 ----- .../v1/document_service/rest/service_stub.rb | 633 --- .../discovery_engine/v1/engine_service.rb | 57 - .../v1/engine_service/client.rb | 942 ---- .../v1/engine_service/credentials.rb | 47 - .../v1/engine_service/operations.rb | 841 ---- .../v1/engine_service/paths.rb | 73 - .../v1/engine_service/rest.rb | 54 - .../v1/engine_service/rest/client.rb | 864 ---- .../v1/engine_service/rest/operations.rb | 1159 ----- .../v1/engine_service/rest/service_stub.rb | 388 -- .../v1/grounded_generation_service.rb | 55 - .../v1/grounded_generation_service/client.rb | 733 ---- .../credentials.rb | 47 - .../v1/grounded_generation_service/paths.rb | 137 - .../v1/grounded_generation_service/rest.rb | 52 - .../rest/client.rb | 591 --- .../rest/service_stub.rb | 205 - .../v1/identity_mapping_store_service.rb | 56 - .../identity_mapping_store_service/client.rb | 1177 ----- .../credentials.rb | 47 - .../operations.rb | 841 ---- .../identity_mapping_store_service/paths.rb | 154 - .../v1/identity_mapping_store_service/rest.rb | 53 - .../rest/client.rb | 1085 ----- .../rest/operations.rb | 1159 ----- .../rest/service_stub.rb | 511 --- .../discovery_engine/v1/project_service.rb | 57 - .../v1/project_service/client.rb | 536 --- .../v1/project_service/credentials.rb | 47 - .../v1/project_service/operations.rb | 841 ---- .../v1/project_service/paths.rb | 47 - .../v1/project_service/rest.rb | 54 - .../v1/project_service/rest/client.rb | 486 --- .../v1/project_service/rest/operations.rb | 1159 ----- .../v1/project_service/rest/service_stub.rb | 143 - .../cloud/discovery_engine/v1/rank_service.rb | 55 - .../v1/rank_service/client.rb | 531 --- .../v1/rank_service/credentials.rb | 47 - .../discovery_engine/v1/rank_service/paths.rb | 52 - .../discovery_engine/v1/rank_service/rest.rb | 52 - .../v1/rank_service/rest/client.rb | 481 -- .../v1/rank_service/rest/service_stub.rb | 143 - .../v1/recommendation_service.rb | 55 - .../v1/recommendation_service/client.rb | 609 --- .../v1/recommendation_service/credentials.rb | 47 - .../v1/recommendation_service/paths.rb | 220 - .../v1/recommendation_service/rest.rb | 52 - .../v1/recommendation_service/rest/client.rb | 559 --- .../rest/service_stub.rb | 159 - .../google/cloud/discovery_engine/v1/rest.rb | 57 - .../discovery_engine/v1/schema_service.rb | 56 - .../v1/schema_service/client.rb | 945 ---- .../v1/schema_service/credentials.rb | 47 - .../v1/schema_service/operations.rb | 841 ---- .../v1/schema_service/paths.rb | 127 - .../v1/schema_service/rest.rb | 53 - .../v1/schema_service/rest/client.rb | 867 ---- .../v1/schema_service/rest/operations.rb | 1159 ----- .../v1/schema_service/rest/service_stub.rb | 425 -- .../discovery_engine/v1/search_service.rb | 55 - .../v1/search_service/client.rb | 1315 ------ .../v1/search_service/credentials.rb | 47 - .../v1/search_service/paths.rb | 263 -- .../v1/search_service/rest.rb | 52 - .../v1/search_service/rest/client.rb | 1258 ------ .../v1/search_service/rest/service_stub.rb | 237 - .../v1/search_tuning_service.rb | 56 - .../v1/search_tuning_service/client.rb | 621 --- .../v1/search_tuning_service/credentials.rb | 47 - .../v1/search_tuning_service/operations.rb | 841 ---- .../v1/search_tuning_service/paths.rb | 78 - .../v1/search_tuning_service/rest.rb | 53 - .../v1/search_tuning_service/rest/client.rb | 564 --- .../search_tuning_service/rest/operations.rb | 1159 ----- .../rest/service_stub.rb | 204 - .../v1/serving_config_service.rb | 56 - .../v1/serving_config_service/client.rb | 501 --- .../v1/serving_config_service/credentials.rb | 47 - .../v1/serving_config_service/paths.rb | 101 - .../v1/serving_config_service/rest.rb | 53 - .../v1/serving_config_service/rest/client.rb | 451 -- .../rest/service_stub.rb | 159 - .../discovery_engine/v1/session_service.rb | 55 - .../v1/session_service/client.rb | 937 ---- .../v1/session_service/credentials.rb | 47 - .../v1/session_service/paths.rb | 355 -- .../v1/session_service/rest.rb | 52 - .../v1/session_service/rest/client.rb | 859 ---- .../v1/session_service/rest/service_stub.rb | 462 -- .../v1/site_search_engine_service.rb | 56 - .../v1/site_search_engine_service/client.rb | 2012 --------- .../site_search_engine_service/credentials.rb | 47 - .../site_search_engine_service/operations.rb | 841 ---- .../v1/site_search_engine_service/paths.rb | 176 - .../v1/site_search_engine_service/rest.rb | 53 - .../site_search_engine_service/rest/client.rb | 1864 -------- .../rest/operations.rb | 1159 ----- .../rest/service_stub.rb | 1102 ----- .../discovery_engine/v1/user_event_service.rb | 56 - .../v1/user_event_service/client.rb | 911 ---- .../v1/user_event_service/credentials.rb | 47 - .../v1/user_event_service/operations.rb | 841 ---- .../v1/user_event_service/paths.rb | 152 - .../v1/user_event_service/rest.rb | 53 - .../v1/user_event_service/rest/client.rb | 840 ---- .../v1/user_event_service/rest/operations.rb | 1159 ----- .../user_event_service/rest/service_stub.rb | 382 -- .../v1/user_license_service.rb | 56 - .../v1/user_license_service/client.rb | 647 --- .../v1/user_license_service/credentials.rb | 47 - .../v1/user_license_service/operations.rb | 841 ---- .../v1/user_license_service/paths.rb | 71 - .../v1/user_license_service/rest.rb | 53 - .../v1/user_license_service/rest/client.rb | 590 --- .../user_license_service/rest/operations.rb | 1159 ----- .../user_license_service/rest/service_stub.rb | 204 - .../cloud/discovery_engine/v1/version.rb | 28 - .../cloud/discoveryengine/v1/answer_pb.rb | 73 - .../discoveryengine/v1/assist_answer_pb.rb | 59 - .../cloud/discoveryengine/v1/assistant_pb.rb | 45 - .../v1/assistant_service_pb.rb | 62 - .../v1/assistant_service_services_pb.rb | 45 - .../cloud/discoveryengine/v1/chunk_pb.rb | 53 - .../v1/cmek_config_service_pb.rb | 61 - .../v1/cmek_config_service_services_pb.rb | 55 - .../cloud/discoveryengine/v1/common_pb.rb | 56 - .../cloud/discoveryengine/v1/completion_pb.rb | 46 - .../v1/completion_service_pb.rb | 52 - .../v1/completion_service_services_pb.rb | 61 - .../cloud/discoveryengine/v1/control_pb.rb | 61 - .../discoveryengine/v1/control_service_pb.rb | 57 - .../v1/control_service_services_pb.rb | 69 - .../discoveryengine/v1/conversation_pb.rb | 54 - .../v1/conversational_search_service_pb.rb | 104 - ...nversational_search_service_services_pb.rb | 100 - .../v1/custom_tuning_model_pb.rb | 48 - .../cloud/discoveryengine/v1/data_store_pb.rb | 62 - .../v1/data_store_service_pb.rb | 62 - .../v1/data_store_service_services_pb.rb | 61 - .../cloud/discoveryengine/v1/document_pb.rb | 57 - .../v1/document_processing_config_pb.rb | 51 - .../discoveryengine/v1/document_service_pb.rb | 70 - .../v1/document_service_services_pb.rb | 83 - .../cloud/discoveryengine/v1/engine_pb.rb | 59 - .../discoveryengine/v1/engine_service_pb.rb | 62 - .../v1/engine_service_services_pb.rb | 55 - .../v1/grounded_generation_service_pb.rb | 79 - ...grounded_generation_service_services_pb.rb | 49 - .../cloud/discoveryengine/v1/grounding_pb.rb | 46 - .../v1/identity_mapping_store_pb.rb | 48 - .../v1/identity_mapping_store_service_pb.rb | 68 - ...ntity_mapping_store_service_services_pb.rb | 58 - .../discoveryengine/v1/import_config_pb.rb | 89 - .../cloud/discoveryengine/v1/project_pb.rb | 49 - .../discoveryengine/v1/project_service_pb.rb | 50 - .../v1/project_service_services_pb.rb | 51 - .../discoveryengine/v1/purge_config_pb.rb | 64 - .../discoveryengine/v1/rank_service_pb.rb | 49 - .../v1/rank_service_services_pb.rb | 45 - .../v1/recommendation_service_pb.rb | 55 - .../v1/recommendation_service_services_pb.rb | 45 - .../cloud/discoveryengine/v1/safety_pb.rb | 47 - .../cloud/discoveryengine/v1/schema_pb.rb | 47 - .../discoveryengine/v1/schema_service_pb.rb | 61 - .../v1/schema_service_services_pb.rb | 53 - .../discoveryengine/v1/search_service_pb.rb | 117 - .../v1/search_service_services_pb.rb | 59 - .../v1/search_tuning_service_pb.rb | 61 - .../v1/search_tuning_service_services_pb.rb | 47 - .../discoveryengine/v1/serving_config_pb.rb | 52 - .../v1/serving_config_service_pb.rb | 51 - .../v1/serving_config_service_services_pb.rb | 48 - .../cloud/discoveryengine/v1/session_pb.rb | 54 - .../discoveryengine/v1/session_service_pb.rb | 49 - .../v1/session_service_services_pb.rb | 64 - .../v1/site_search_engine_pb.rb | 55 - .../v1/site_search_engine_service_pb.rb | 91 - .../site_search_engine_service_services_pb.rb | 80 - .../cloud/discoveryengine/v1/user_event_pb.rb | 58 - .../v1/user_event_service_pb.rb | 54 - .../v1/user_event_service_services_pb.rb | 64 - .../discoveryengine/v1/user_license_pb.rb | 48 - .../v1/user_license_service_pb.rb | 61 - .../v1/user_license_service_services_pb.rb | 48 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/httpbody.rb | 80 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/discoveryengine/v1/answer.rb | 510 --- .../cloud/discoveryengine/v1/assist_answer.rb | 278 -- .../cloud/discoveryengine/v1/assistant.rb | 39 - .../discoveryengine/v1/assistant_service.rb | 207 - .../google/cloud/discoveryengine/v1/chunk.rb | 174 - .../discoveryengine/v1/cmek_config_service.rb | 222 - .../google/cloud/discoveryengine/v1/common.rb | 284 -- .../cloud/discoveryengine/v1/completion.rb | 88 - .../discoveryengine/v1/completion_service.rb | 117 - .../cloud/discoveryengine/v1/control.rb | 339 -- .../discoveryengine/v1/control_service.rb | 126 - .../cloud/discoveryengine/v1/conversation.rb | 119 - .../v1/conversational_search_service.rb | 982 ----- .../discoveryengine/v1/custom_tuning_model.rb | 99 - .../cloud/discoveryengine/v1/data_store.rb | 288 -- .../discoveryengine/v1/data_store_service.rb | 236 - .../cloud/discoveryengine/v1/document.rb | 245 -- .../v1/document_processing_config.rb | 176 - .../discoveryengine/v1/document_service.rb | 313 -- .../google/cloud/discoveryengine/v1/engine.rb | 371 -- .../discoveryengine/v1/engine_service.rb | 177 - .../v1/grounded_generation_service.rb | 620 --- .../cloud/discoveryengine/v1/grounding.rb | 88 - .../v1/identity_mapping_store.rb | 81 - .../v1/identity_mapping_store_service.rb | 279 -- .../cloud/discoveryengine/v1/import_config.rb | 867 ---- .../cloud/discoveryengine/v1/project.rb | 106 - .../discoveryengine/v1/project_service.rb | 57 - .../cloud/discoveryengine/v1/purge_config.rb | 293 -- .../cloud/discoveryengine/v1/rank_service.rb | 126 - .../v1/recommendation_service.rb | 230 - .../google/cloud/discoveryengine/v1/safety.rb | 108 - .../google/cloud/discoveryengine/v1/schema.rb | 49 - .../discoveryengine/v1/schema_service.rb | 177 - .../discoveryengine/v1/search_service.rb | 1946 --------- .../v1/search_tuning_service.rb | 172 - .../discoveryengine/v1/serving_config.rb | 261 -- .../v1/serving_config_service.rb | 44 - .../cloud/discoveryengine/v1/session.rb | 134 - .../discoveryengine/v1/site_search_engine.rb | 186 - .../v1/site_search_engine_service.rb | 672 --- .../cloud/discoveryengine/v1/user_event.rb | 548 --- .../discoveryengine/v1/user_event_service.rb | 84 - .../cloud/discoveryengine/v1/user_license.rb | 85 - .../v1/user_license_service.rb | 153 - .../google/longrunning/operations.rb | 191 - .../proto_docs/google/protobuf/any.rb | 145 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/protobuf/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/date.rb | 53 - .../snippets/Gemfile | 32 - .../assistant_service/stream_assist.rb | 50 - .../cmek_config_service/delete_cmek_config.rb | 54 - .../cmek_config_service/get_cmek_config.rb | 47 - .../cmek_config_service/list_cmek_configs.rb | 47 - .../cmek_config_service/update_cmek_config.rb | 54 - .../completion_service/complete_query.rb | 47 - .../import_completion_suggestions.rb | 54 - .../import_suggestion_deny_list_entries.rb | 54 - .../purge_completion_suggestions.rb | 54 - .../purge_suggestion_deny_list_entries.rb | 54 - .../control_service/create_control.rb | 47 - .../control_service/delete_control.rb | 47 - .../snippets/control_service/get_control.rb | 47 - .../snippets/control_service/list_controls.rb | 51 - .../control_service/update_control.rb | 47 - .../answer_query.rb | 47 - .../converse_conversation.rb | 47 - .../create_conversation.rb | 47 - .../create_session.rb | 47 - .../delete_conversation.rb | 47 - .../delete_session.rb | 47 - .../get_answer.rb | 47 - .../get_conversation.rb | 47 - .../get_session.rb | 47 - .../list_conversations.rb | 51 - .../list_sessions.rb | 51 - .../stream_answer_query.rb | 50 - .../update_conversation.rb | 47 - .../update_session.rb | 47 - .../data_store_service/create_data_store.rb | 54 - .../data_store_service/delete_data_store.rb | 54 - .../data_store_service/get_data_store.rb | 47 - .../data_store_service/list_data_stores.rb | 51 - .../data_store_service/update_data_store.rb | 47 - .../batch_get_documents_metadata.rb | 47 - .../document_service/create_document.rb | 47 - .../document_service/delete_document.rb | 47 - .../snippets/document_service/get_document.rb | 47 - .../document_service/import_documents.rb | 54 - .../document_service/list_documents.rb | 51 - .../document_service/purge_documents.rb | 54 - .../document_service/update_document.rb | 47 - .../snippets/engine_service/create_engine.rb | 54 - .../snippets/engine_service/delete_engine.rb | 54 - .../snippets/engine_service/get_engine.rb | 47 - .../snippets/engine_service/list_engines.rb | 51 - .../snippets/engine_service/update_engine.rb | 47 - .../check_grounding.rb | 47 - .../generate_grounded_content.rb | 47 - .../stream_generate_grounded_content.rb | 56 - .../create_identity_mapping_store.rb | 47 - .../delete_identity_mapping_store.rb | 54 - .../get_identity_mapping_store.rb | 47 - .../import_identity_mappings.rb | 54 - .../list_identity_mapping_stores.rb | 51 - .../list_identity_mappings.rb | 51 - .../purge_identity_mappings.rb | 54 - .../project_service/provision_project.rb | 54 - .../snippets/rank_service/rank.rb | 47 - .../recommendation_service/recommend.rb | 47 - .../snippets/schema_service/create_schema.rb | 54 - .../snippets/schema_service/delete_schema.rb | 54 - .../snippets/schema_service/get_schema.rb | 47 - .../snippets/schema_service/list_schemas.rb | 51 - .../snippets/schema_service/update_schema.rb | 54 - .../snippets/search_service/search.rb | 51 - .../snippets/search_service/search_lite.rb | 51 - .../list_custom_models.rb | 47 - .../train_custom_model.rb | 54 - .../update_serving_config.rb | 47 - .../session_service/create_session.rb | 47 - .../session_service/delete_session.rb | 47 - .../snippets/session_service/get_session.rb | 47 - .../snippets/session_service/list_sessions.rb | 51 - .../session_service/update_session.rb | 47 - .../batch_create_target_sites.rb | 54 - .../batch_verify_target_sites.rb | 54 - .../create_sitemap.rb | 54 - .../create_target_site.rb | 54 - .../delete_sitemap.rb | 54 - .../delete_target_site.rb | 54 - .../disable_advanced_site_search.rb | 54 - .../enable_advanced_site_search.rb | 54 - .../fetch_domain_verification_status.rb | 51 - .../fetch_sitemaps.rb | 47 - .../get_site_search_engine.rb | 47 - .../get_target_site.rb | 47 - .../list_target_sites.rb | 51 - .../recrawl_uris.rb | 54 - .../update_target_site.rb | 54 - ...adata_google.cloud.discoveryengine.v1.json | 3855 ----------------- .../user_event_service/collect_user_event.rb | 47 - .../user_event_service/import_user_events.rb | 54 - .../user_event_service/purge_user_events.rb | 54 - .../user_event_service/write_user_event.rb | 47 - .../batch_update_user_licenses.rb | 54 - .../list_user_licenses.rb | 51 - .../v1/assistant_service_paths_test.rb | 88 - .../v1/assistant_service_rest_test.rb | 158 - .../v1/assistant_service_test.rb | 187 - .../v1/cmek_config_service_operations_test.rb | 400 -- .../v1/cmek_config_service_paths_test.rb | 94 - .../v1/cmek_config_service_rest_test.rb | 316 -- .../v1/cmek_config_service_test.rb | 362 -- .../v1/completion_service_operations_test.rb | 400 -- .../v1/completion_service_paths_test.rb | 58 - .../v1/completion_service_rest_test.rb | 376 -- .../v1/completion_service_test.rb | 444 -- .../v1/control_service_paths_test.rb | 103 - .../v1/control_service_rest_test.rb | 375 -- .../v1/control_service_test.rb | 411 -- ...onversational_search_service_paths_test.rb | 172 - ...conversational_search_service_rest_test.rb | 900 ---- .../v1/conversational_search_service_test.rb | 1031 ----- .../v1/data_store_service_operations_test.rb | 400 -- .../v1/data_store_service_paths_test.rb | 151 - .../v1/data_store_service_rest_test.rb | 378 -- .../v1/data_store_service_test.rb | 442 -- .../v1/document_service_operations_test.rb | 400 -- .../v1/document_service_paths_test.rb | 97 - .../v1/document_service_rest_test.rb | 549 --- .../v1/document_service_test.rb | 635 --- .../v1/engine_service_operations_test.rb | 400 -- .../v1/engine_service_paths_test.rb | 67 - .../v1/engine_service_rest_test.rb | 375 -- .../v1/engine_service_test.rb | 435 -- .../grounded_generation_service_paths_test.rb | 85 - .../grounded_generation_service_rest_test.rb | 216 - .../v1/grounded_generation_service_test.rb | 336 -- ...y_mapping_store_service_operations_test.rb | 400 -- ...entity_mapping_store_service_paths_test.rb | 106 - ...dentity_mapping_store_service_rest_test.rb | 488 --- .../v1/identity_mapping_store_service_test.rb | 575 --- .../v1/project_service_operations_test.rb | 400 -- .../v1/project_service_paths_test.rb | 55 - .../v1/project_service_rest_test.rb | 155 - .../v1/project_service_test.rb | 185 - .../v1/rank_service_paths_test.rb | 55 - .../v1/rank_service_rest_test.rb | 159 - .../discovery_engine/v1/rank_service_test.rb | 174 - .../v1/recommendation_service_paths_test.rb | 103 - .../v1/recommendation_service_rest_test.rb | 159 - .../v1/recommendation_service_test.rb | 174 - .../v1/schema_service_operations_test.rb | 400 -- .../v1/schema_service_paths_test.rb | 73 - .../v1/schema_service_rest_test.rb | 374 -- .../v1/schema_service_test.rb | 438 -- .../v1/search_service_paths_test.rb | 109 - .../v1/search_service_rest_test.rb | 273 -- .../v1/search_service_test.rb | 362 -- .../search_tuning_service_operations_test.rb | 400 -- .../v1/search_tuning_service_paths_test.rb | 58 - .../v1/search_tuning_service_rest_test.rb | 211 - .../v1/search_tuning_service_test.rb | 248 -- .../v1/serving_config_service_paths_test.rb | 61 - .../v1/serving_config_service_rest_test.rb | 154 - .../v1/serving_config_service_test.rb | 164 - .../v1/session_service_paths_test.rb | 136 - .../v1/session_service_rest_test.rb | 376 -- .../v1/session_service_test.rb | 413 -- ...e_search_engine_service_operations_test.rb | 400 -- .../site_search_engine_service_paths_test.rb | 88 - .../site_search_engine_service_rest_test.rb | 919 ---- .../v1/site_search_engine_service_test.rb | 1068 ----- .../v1/user_event_service_operations_test.rb | 400 -- .../v1/user_event_service_paths_test.rb | 85 - .../v1/user_event_service_rest_test.rb | 324 -- .../v1/user_event_service_test.rb | 382 -- .../user_license_service_operations_test.rb | 400 -- .../v1/user_license_service_paths_test.rb | 67 - .../v1/user_license_service_rest_test.rb | 212 - .../v1/user_license_service_test.rb | 255 -- .../test/helper.rb | 25 - 497 files changed, 1007 insertions(+), 130186 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/safety_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/schema_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb index fe9b73a30ca0..3b520dc34f30 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb @@ -217,7 +217,7 @@ def logger # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil) + # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) # Pass arguments to `search` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -237,6 +237,24 @@ def logger # documents under the default branch. # @param query [::String] # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] # Raw image query. # @param page_size [::Integer] @@ -267,6 +285,8 @@ def logger # unset. # # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. # @param one_box_page_size [::Integer] # The maximum number of results to return for OneBox. # This applies to each OneBox type individually. @@ -364,10 +384,10 @@ def logger # The spell correction specification that specifies the mode under # which spell correction takes effect. # @param user_pseudo_id [::String] - # 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. + # Optional. 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`. # @@ -380,72 +400,9 @@ def logger # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] # A specification for configuring the behavior of content search. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. # @param ranking_expression [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. This overrides + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. # The syntax and supported features depend on the # `ranking_expression_backend` value. If `ranking_expression_backend` is not @@ -535,7 +492,90 @@ def logger # the document. # * `base_rank`: the default rank of the result # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # The backend to use for the ranking expression evaluation. + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] @@ -632,7 +672,7 @@ def search request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload search_lite(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil) + # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) # Pass arguments to `search_lite` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -652,6 +692,24 @@ def search request, options = nil # documents under the default branch. # @param query [::String] # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] # Raw image query. # @param page_size [::Integer] @@ -682,6 +740,8 @@ def search request, options = nil # unset. # # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. # @param one_box_page_size [::Integer] # The maximum number of results to return for OneBox. # This applies to each OneBox type individually. @@ -779,10 +839,10 @@ def search request, options = nil # The spell correction specification that specifies the mode under # which spell correction takes effect. # @param user_pseudo_id [::String] - # 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. + # Optional. 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`. # @@ -795,72 +855,9 @@ def search request, options = nil # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] # A specification for configuring the behavior of content search. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. # @param ranking_expression [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. This overrides + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. # The syntax and supported features depend on the # `ranking_expression_backend` value. If `ranking_expression_backend` is not @@ -950,7 +947,90 @@ def search request, options = nil # the document. # * `base_rank`: the default rank of the result # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # The backend to use for the ranking expression evaluation. + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb index d8afe1edd333..e0cefc05ce70 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb @@ -210,7 +210,7 @@ def logger # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload search(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil) + # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) # Pass arguments to `search` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -230,6 +230,24 @@ def logger # documents under the default branch. # @param query [::String] # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] # Raw image query. # @param page_size [::Integer] @@ -260,6 +278,8 @@ def logger # unset. # # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. # @param one_box_page_size [::Integer] # The maximum number of results to return for OneBox. # This applies to each OneBox type individually. @@ -357,10 +377,10 @@ def logger # The spell correction specification that specifies the mode under # which spell correction takes effect. # @param user_pseudo_id [::String] - # 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. + # Optional. 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`. # @@ -373,72 +393,9 @@ def logger # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] # A specification for configuring the behavior of content search. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. # @param ranking_expression [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. This overrides + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. # The syntax and supported features depend on the # `ranking_expression_backend` value. If `ranking_expression_backend` is not @@ -528,7 +485,90 @@ def logger # the document. # * `base_rank`: the default rank of the result # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # The backend to use for the ranking expression evaluation. + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -618,7 +658,7 @@ def search request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload search_lite(serving_config: nil, branch: nil, query: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, safe_search: nil, user_labels: nil, search_as_you_type_spec: nil, display_spec: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil, ranking_expression: nil, ranking_expression_backend: nil) + # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) # Pass arguments to `search_lite` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -638,6 +678,24 @@ def search request, options = nil # documents under the default branch. # @param query [::String] # Raw search query. + # @param page_categories [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] # Raw image query. # @param page_size [::Integer] @@ -668,6 +726,8 @@ def search request, options = nil # unset. # # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. # @param one_box_page_size [::Integer] # The maximum number of results to return for OneBox. # This applies to each OneBox type individually. @@ -765,10 +825,10 @@ def search request, options = nil # The spell correction specification that specifies the mode under # which spell correction takes effect. # @param user_pseudo_id [::String] - # 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. + # Optional. 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`. # @@ -781,72 +841,9 @@ def search request, options = nil # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] # A specification for configuring the behavior of content search. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. # @param ranking_expression [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. This overrides + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. # The syntax and supported features depend on the # `ranking_expression_backend` value. If `ranking_expression_backend` is not @@ -936,7 +933,90 @@ def search request, options = nil # the document. # * `base_rank`: the default rank of the result # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # The backend to use for the ranking expression evaluation. + # Optional. The backend to use for the ranking expression evaluation. + # @param safe_search [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @param user_labels [::Hash{::String => ::String}] + # 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. + # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] + # Optional. Config for display feature, like match highlighting on search + # results. + # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @param session [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] + # Session specification. + # + # Can be used only when `session` is set. + # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] + # Optional. The specification for returning the relevance score. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] # @yieldparam operation [::Gapic::Rest::TransportOperation] diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb index be1680f24e50..069619b9b2a9 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb @@ -13,7 +13,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n0google/cloud/discoveryengine/v1/data_store.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/cmek_config_service.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a@google/cloud/discoveryengine/v1/document_processing_config.proto\x1a,google/cloud/discoveryengine/v1/schema.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\r\n\tDataStore\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x05\x12\x45\n\x0esolution_types\x18\x05 \x03(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionType\x12\x1e\n\x11\x64\x65\x66\x61ult_schema_id\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12U\n\x0e\x63ontent_config\x18\x06 \x01(\x0e\x32\x38.google.cloud.discoveryengine.v1.DataStore.ContentConfigB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x1b\x61\x64vanced_site_search_config\x18\x0c \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AdvancedSiteSearchConfigB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18 \x01(\tB\x03\xe0\x41\x04\x12\x45\n\x0b\x63mek_config\x18\x12 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x03\x12]\n\x12\x62illing_estimation\x18\x17 \x01(\x0b\x32<.google.cloud.discoveryengine.v1.DataStore.BillingEstimationB\x03\xe0\x41\x03\x12\x18\n\x0b\x61\x63l_enabled\x18\x18 \x01(\x08\x42\x03\xe0\x41\x05\x12J\n\x10workspace_config\x18\x19 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.WorkspaceConfig\x12]\n\x1a\x64ocument_processing_config\x18\x1b \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.DocumentProcessingConfig\x12@\n\x0fstarting_schema\x18\x1c \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Schema\x12Z\n\x16healthcare_fhir_config\x18\x1d \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.HealthcareFhirConfigB\x03\xe0\x41\x01\x12[\n\x16identity_mapping_store\x18\x1f \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3discoveryengine.googleapis.com/IdentityMappingStore\x1a\xae\x02\n\x11\x42illingEstimation\x12\x1c\n\x14structured_data_size\x18\x01 \x01(\x03\x12\x1e\n\x16unstructured_data_size\x18\x02 \x01(\x03\x12\x19\n\x11website_data_size\x18\x03 \x01(\x03\x12?\n\x1bstructured_data_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x1dunstructured_data_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x18website_data_update_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x7f\n\rContentConfig\x12\x1e\n\x1a\x43ONTENT_CONFIG_UNSPECIFIED\x10\x00\x12\x0e\n\nNO_CONTENT\x10\x01\x12\x14\n\x10\x43ONTENT_REQUIRED\x10\x02\x12\x12\n\x0ePUBLIC_WEBSITE\x10\x03\x12\x14\n\x10GOOGLE_WORKSPACE\x10\x04:\xc9\x01\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\"\x9e\x01\n\x18\x41\x64vancedSiteSearchConfig\x12\"\n\x15\x64isable_initial_index\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12&\n\x19\x64isable_automatic_refresh\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x18\n\x16_disable_initial_indexB\x1c\n\x1a_disable_automatic_refresh\"\xf5\x02\n\x0fWorkspaceConfig\x12\x43\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.WorkspaceConfig.Type\x12\x1a\n\x12\x64\x61sher_customer_id\x18\x02 \x01(\t\x12(\n\x1bsuper_admin_service_account\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19super_admin_email_address\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_DRIVE\x10\x01\x12\x0f\n\x0bGOOGLE_MAIL\x10\x02\x12\x10\n\x0cGOOGLE_SITES\x10\x03\x12\x13\n\x0fGOOGLE_CALENDAR\x10\x04\x12\x0f\n\x0bGOOGLE_CHAT\x10\x05\x12\x11\n\rGOOGLE_GROUPS\x10\x06\x12\x0f\n\x0bGOOGLE_KEEP\x10\x07\x12\x11\n\rGOOGLE_PEOPLE\x10\x08\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x44\x61taStoreProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" +descriptor_data = "\n0google/cloud/discoveryengine/v1/data_store.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/cmek_config_service.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a@google/cloud/discoveryengine/v1/document_processing_config.proto\x1a,google/cloud/discoveryengine/v1/schema.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xec\x0e\n\tDataStore\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x05\x12\x45\n\x0esolution_types\x18\x05 \x03(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionType\x12\x1e\n\x11\x64\x65\x66\x61ult_schema_id\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12U\n\x0e\x63ontent_config\x18\x06 \x01(\x0e\x32\x38.google.cloud.discoveryengine.v1.DataStore.ContentConfigB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x1b\x61\x64vanced_site_search_config\x18\x0c \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AdvancedSiteSearchConfigB\x03\xe0\x41\x01\x12\x82\x01\n+natural_language_query_understanding_config\x18\" \x01(\x0b\x32H.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfigB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18 \x01(\tB\x03\xe0\x41\x04\x12\x45\n\x0b\x63mek_config\x18\x12 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x03\x12]\n\x12\x62illing_estimation\x18\x17 \x01(\x0b\x32<.google.cloud.discoveryengine.v1.DataStore.BillingEstimationB\x03\xe0\x41\x03\x12\x18\n\x0b\x61\x63l_enabled\x18\x18 \x01(\x08\x42\x03\xe0\x41\x05\x12J\n\x10workspace_config\x18\x19 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.WorkspaceConfig\x12]\n\x1a\x64ocument_processing_config\x18\x1b \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.DocumentProcessingConfig\x12@\n\x0fstarting_schema\x18\x1c \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Schema\x12Z\n\x16healthcare_fhir_config\x18\x1d \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.HealthcareFhirConfigB\x03\xe0\x41\x01\x12[\n\x16identity_mapping_store\x18\x1f \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3discoveryengine.googleapis.com/IdentityMappingStore\x1a\xae\x02\n\x11\x42illingEstimation\x12\x1c\n\x14structured_data_size\x18\x01 \x01(\x03\x12\x1e\n\x16unstructured_data_size\x18\x02 \x01(\x03\x12\x19\n\x11website_data_size\x18\x03 \x01(\x03\x12?\n\x1bstructured_data_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x1dunstructured_data_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x18website_data_update_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x7f\n\rContentConfig\x12\x1e\n\x1a\x43ONTENT_CONFIG_UNSPECIFIED\x10\x00\x12\x0e\n\nNO_CONTENT\x10\x01\x12\x14\n\x10\x43ONTENT_REQUIRED\x10\x02\x12\x12\n\x0ePUBLIC_WEBSITE\x10\x03\x12\x14\n\x10GOOGLE_WORKSPACE\x10\x04:\xc9\x01\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\"\x9e\x01\n\x18\x41\x64vancedSiteSearchConfig\x12\"\n\x15\x64isable_initial_index\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12&\n\x19\x64isable_automatic_refresh\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x18\n\x16_disable_initial_indexB\x1c\n\x1a_disable_automatic_refresh\"\xbf\x01\n\'NaturalLanguageQueryUnderstandingConfig\x12[\n\x04mode\x18\x01 \x01(\x0e\x32M.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"\xf5\x02\n\x0fWorkspaceConfig\x12\x43\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.WorkspaceConfig.Type\x12\x1a\n\x12\x64\x61sher_customer_id\x18\x02 \x01(\t\x12(\n\x1bsuper_admin_service_account\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19super_admin_email_address\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_DRIVE\x10\x01\x12\x0f\n\x0bGOOGLE_MAIL\x10\x02\x12\x10\n\x0cGOOGLE_SITES\x10\x03\x12\x13\n\x0fGOOGLE_CALENDAR\x10\x04\x12\x0f\n\x0bGOOGLE_CHAT\x10\x05\x12\x11\n\rGOOGLE_GROUPS\x10\x06\x12\x0f\n\x0bGOOGLE_KEEP\x10\x07\x12\x11\n\rGOOGLE_PEOPLE\x10\x08\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x44\x61taStoreProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -52,6 +52,8 @@ module V1 DataStore::BillingEstimation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.BillingEstimation").msgclass DataStore::ContentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.ContentConfig").enummodule AdvancedSiteSearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AdvancedSiteSearchConfig").msgclass + NaturalLanguageQueryUnderstandingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig").msgclass + NaturalLanguageQueryUnderstandingConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode").enummodule WorkspaceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig").msgclass WorkspaceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig.Type").enummodule end diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb index b232a597ae20..4499260a81bb 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_pb.rb @@ -14,7 +14,7 @@ require 'google/protobuf/struct_pb' -descriptor_data = "\n4google/cloud/discoveryengine/v1/search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/discoveryengine/v1/chunk.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xca\x32\n\rSearchRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x06\x62ranch\x18\x02 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12N\n\x0bimage_query\x18\x13 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12\x19\n\x11one_box_page_size\x18/ \x01(\x05\x12V\n\x10\x64\x61ta_store_specs\x18 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x12\x0e\n\x06\x66ilter\x18\x07 \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1d \x01(\t\x12\x10\n\x08order_by\x18\x08 \x01(\t\x12<\n\tuser_info\x18\x15 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x15\n\rlanguage_code\x18# \x01(\t\x12M\n\x0b\x66\x61\x63\x65t_specs\x18\t \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12J\n\x06params\x18\x0b \x03(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.ParamsEntry\x12_\n\x14query_expansion_spec\x18\r \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec\x12\x61\n\x15spell_correction_spec\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec\x12\x16\n\x0euser_pseudo_id\x18\x0f \x01(\t\x12]\n\x13\x63ontent_search_spec\x18\x18 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec\x12\x13\n\x0bsafe_search\x18\x14 \x01(\x08\x12S\n\x0buser_labels\x18\x16 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x12\x1a\n\x12ranking_expression\x18\x1a \x01(\t\x12p\n\x1aranking_expression_backend\x18\x35 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackendB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"~\n\x18RankingExpressionBackend\x12*\n&RANKING_EXPRESSION_BACKEND_UNSPECIFIED\x10\x00\x12\x15\n\x11RANK_BY_EMBEDDING\x10\x03\x12\x13\n\x0fRANK_BY_FORMULA\x10\x04\"\x04\x08\x01\x10\x01\"\x04\x08\x02\x10\x02\"\xbe\x1c\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x1a\xaf\x08\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x12\x63\n\x0crank_signals\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignalsB\x03\xe0\x41\x01\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xee\x04\n\x0bRankSignals\x12*\n\x18keyword_similarity_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12!\n\x0frelevance_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12+\n\x19semantic_similarity_score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1b\n\tpctr_rank\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12!\n\x0ftopicality_rank\x18\x06 \x01(\x02\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1e\n\x0c\x64ocument_age\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12!\n\x0f\x62oosting_factor\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x19\n\x0c\x64\x65\x66\x61ult_rank\x18 \x01(\x02\x42\x03\xe0\x41\x01\x12r\n\x0e\x63ustom_signals\x18! \x03(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignalB\x03\xe0\x41\x01\x1a\x35\n\x0c\x43ustomSignal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x42\x1b\n\x19_keyword_similarity_scoreB\x12\n\x10_relevance_scoreB\x1c\n\x1a_semantic_similarity_scoreB\x0c\n\n_pctr_rankB\x12\n\x10_topicality_rankB\x0f\n\r_document_ageB\x12\n\x10_boosting_factorJ\x04\x08\x05\x10\x06\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t2\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" +descriptor_data = "\n4google/cloud/discoveryengine/v1/search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a+google/cloud/discoveryengine/v1/chunk.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb1;\n\rSearchRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x06\x62ranch\x18\x02 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\r\n\x05query\x18\x03 \x01(\t\x12\x1c\n\x0fpage_categories\x18? \x03(\tB\x03\xe0\x41\x01\x12N\n\x0bimage_query\x18\x13 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.SearchRequest.ImageQuery\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12\x19\n\x11one_box_page_size\x18/ \x01(\x05\x12V\n\x10\x64\x61ta_store_specs\x18 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x12\x0e\n\x06\x66ilter\x18\x07 \x01(\t\x12\x18\n\x10\x63\x61nonical_filter\x18\x1d \x01(\t\x12\x10\n\x08order_by\x18\x08 \x01(\t\x12<\n\tuser_info\x18\x15 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x15\n\rlanguage_code\x18# \x01(\t\x12M\n\x0b\x66\x61\x63\x65t_specs\x18\t \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12J\n\x06params\x18\x0b \x03(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.ParamsEntry\x12_\n\x14query_expansion_spec\x18\r \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec\x12\x61\n\x15spell_correction_spec\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec\x12\x1b\n\x0euser_pseudo_id\x18\x0f \x01(\tB\x03\xe0\x41\x01\x12]\n\x13\x63ontent_search_spec\x18\x18 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec\x12\x1f\n\x12ranking_expression\x18\x1a \x01(\tB\x03\xe0\x41\x01\x12p\n\x1aranking_expression_backend\x18\x35 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackendB\x03\xe0\x41\x01\x12\x13\n\x0bsafe_search\x18\x14 \x01(\x08\x12S\n\x0buser_labels\x18\x16 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x8c\x01\n)natural_language_query_understanding_spec\x18\x1c \x01(\x0b\x32T.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpecB\x03\xe0\x41\x01\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12X\n\x0e\x63rowding_specs\x18( \x03(\x0b\x32;.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xe0\x04\n%NaturalLanguageQueryUnderstandingSpec\x12\x93\x01\n\x1b\x66ilter_extraction_condition\x18\x01 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition\x12.\n&geo_search_query_detection_field_names\x18\x02 \x03(\t\x12\x94\x01\n\x19\x65xtracted_filter_behavior\x18\x03 \x01(\x0e\x32l.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehaviorB\x03\xe0\x41\x01\x12 \n\x13\x61llowed_field_names\x18\x04 \x03(\tB\x03\xe0\x41\x01\"Q\n\x19\x46ilterExtractionCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"e\n\x17\x45xtractedFilterBehavior\x12)\n%EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHARD_FILTER\x10\x01\x12\x0e\n\nSOFT_BOOST\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1a\xdb\x01\n\x0c\x43rowdingSpec\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12N\n\x04mode\x18\x03 \x01(\x0e\x32@.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode\"Y\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x44ROP_CROWDED_RESULTS\x10\x01\x12!\n\x1d\x44\x45MOTE_CROWDED_RESULTS_TO_END\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x92\x01\n\x18RankingExpressionBackend\x12*\n&RANKING_EXPRESSION_BACKEND_UNSPECIFIED\x10\x00\x12\x0c\n\x04\x42YOE\x10\x01\x1a\x02\x08\x01\x12\x10\n\x08\x43LEARBOX\x10\x02\x1a\x02\x08\x01\x12\x15\n\x11RANK_BY_EMBEDDING\x10\x03\x12\x13\n\x0fRANK_BY_FORMULA\x10\x04\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xe6/\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12\x8d\x01\n)natural_language_query_understanding_info\x18\x0f \x01(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfoB\x03\xe0\x41\x03\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x12Z\n\x0esemantic_state\x18$ \x01(\x0e\x32=.google.cloud.discoveryengine.v1.SearchResponse.SemanticStateB\x03\xe0\x41\x03\x1a\xa9\x08\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x12\x63\n\x0crank_signals\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignalsB\x03\xe0\x41\x01\x1a\xe8\x04\n\x0bRankSignals\x12*\n\x18keyword_similarity_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12!\n\x0frelevance_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12+\n\x19semantic_similarity_score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1b\n\tpctr_rank\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12!\n\x0ftopicality_rank\x18\x06 \x01(\x02\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1e\n\x0c\x64ocument_age\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12!\n\x0f\x62oosting_factor\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x19\n\x0c\x64\x65\x66\x61ult_rank\x18 \x01(\x02\x42\x03\xe0\x41\x01\x12r\n\x0e\x63ustom_signals\x18! \x03(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignalB\x03\xe0\x41\x01\x1a\x35\n\x0c\x43ustomSignal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x42\x1b\n\x19_keyword_similarity_scoreB\x12\n\x10_relevance_scoreB\x1c\n\x1a_semantic_similarity_scoreB\x0c\n\n_pctr_rankB\x12\n\x10_topicality_rankB\x0f\n\r_document_ageB\x12\n\x10_boosting_factor\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xf3\x10\n%NaturalLanguageQueryUnderstandingInfo\x12\x19\n\x11\x65xtracted_filters\x18\x01 \x01(\t\x12\x17\n\x0frewritten_query\x18\x02 \x01(\t\x12\x1a\n\x12\x63lassified_intents\x18\x05 \x03(\t\x12\x94\x01\n\x1bstructured_extracted_filter\x18\x03 \x01(\x0b\x32o.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter\x1a\xe2\x0e\n\x19StructuredExtractedFilter\x12\x8e\x01\n\nexpression\x18\x01 \x01(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1aM\n\x10StringConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0e\n\x06values\x18\x02 \x03(\t\x12\x15\n\rquery_segment\x18\x03 \x01(\t\x1a\xf6\x02\n\x10NumberConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\xa0\x01\n\ncomparison\x18\x02 \x01(\x0e\x32\x8b\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison\x12\r\n\x05value\x18\x03 \x01(\x01\x12\x15\n\rquery_segment\x18\x04 \x01(\t\"\x84\x01\n\nComparison\x12\x1a\n\x16\x43OMPARISON_UNSPECIFIED\x10\x00\x12\n\n\x06\x45QUALS\x10\x01\x12\x14\n\x10LESS_THAN_EQUALS\x10\x02\x12\r\n\tLESS_THAN\x10\x03\x12\x17\n\x13GREATER_THAN_EQUALS\x10\x04\x12\x10\n\x0cGREATER_THAN\x10\x05\x1a{\n\x15GeolocationConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x10\n\x08latitude\x18\x04 \x01(\x01\x12\x11\n\tlongitude\x18\x05 \x01(\x01\x12\x18\n\x10radius_in_meters\x18\x03 \x01(\x02\x1a\xa1\x01\n\rAndExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa0\x01\n\x0cOrExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa7\x06\n\nExpression\x12\x9e\x01\n\x11string_constraint\x18\x01 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraintH\x00\x12\x9e\x01\n\x11number_constraint\x18\x02 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraintH\x00\x12\xa8\x01\n\x16geolocation_constraint\x18\x03 \x01(\x0b\x32\x85\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraintH\x00\x12\x91\x01\n\x08\x61nd_expr\x18\x04 \x01(\x0b\x32}.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpressionH\x00\x12\x8f\x01\n\x07or_expr\x18\x05 \x01(\x0b\x32|.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpressionH\x00\x42\x06\n\x04\x65xpr\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t\"J\n\rSemanticState\x12\x1e\n\x1aSEMANTIC_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x32\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -71,14 +71,19 @@ module V1 SearchRequest::ContentSearchSpec::ExtractiveContentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec").msgclass SearchRequest::ContentSearchSpec::ChunkSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec").msgclass SearchRequest::ContentSearchSpec::SearchResultMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode").enummodule + SearchRequest::NaturalLanguageQueryUnderstandingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec").msgclass + SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition").enummodule + SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehavior").enummodule SearchRequest::SearchAsYouTypeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec").msgclass SearchRequest::SearchAsYouTypeSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition").enummodule SearchRequest::DisplaySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec").msgclass SearchRequest::DisplaySpec::MatchHighlightingCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition").enummodule + SearchRequest::CrowdingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec").msgclass + SearchRequest::CrowdingSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode").enummodule SearchRequest::SessionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SessionSpec").msgclass SearchRequest::RelevanceScoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec").msgclass - SearchRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold").enummodule SearchRequest::RankingExpressionBackend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend").enummodule + SearchRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold").enummodule SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse").msgclass SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult").msgclass SearchResponse::SearchResult::RankSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals").msgclass @@ -95,7 +100,17 @@ module V1 SearchResponse::Summary::SummaryWithMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata").msgclass SearchResponse::Summary::SummarySkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason").enummodule SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison").enummodule + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraint").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpression").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpression").msgclass + SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression").msgclass SearchResponse::SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SessionInfo").msgclass + SearchResponse::SemanticState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SemanticState").enummodule end end end diff --git a/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb b/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb index 199e7f965f7f..5f7ca6698b31 100644 --- a/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +++ b/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb @@ -64,6 +64,9 @@ module V1 # @!attribute [rw] advanced_site_search_config # @return [::Google::Cloud::DiscoveryEngine::V1::AdvancedSiteSearchConfig] # Optional. Configuration for advanced site search. + # @!attribute [rw] natural_language_query_understanding_config + # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig] + # Optional. Configuration for Natural Language Query Understanding. # @!attribute [rw] kms_key_name # @return [::String] # Input only. The KMS key to be used to protect this DataStore at creation @@ -201,6 +204,33 @@ class AdvancedSiteSearchConfig extend ::Google::Protobuf::MessageExts::ClassMethods end + # Configuration for Natural Language Query Understanding. + # @!attribute [rw] mode + # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode] + # Mode of Natural Language Query Understanding. If this field is unset, the + # behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode::DISABLED NaturalLanguageQueryUnderstandingConfig.Mode.DISABLED}. + class NaturalLanguageQueryUnderstandingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mode of Natural Language Query Understanding. When the + # NaturalLanguageQueryUnderstandingConfig.Mode is ENABLED, the natural + # language understanding capabilities will be enabled for a search request if + # the NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition in the + # SearchRequest is ENABLED. + module Mode + # Default value. + MODE_UNSPECIFIED = 0 + + # Natural Language Query Understanding is disabled. + DISABLED = 1 + + # Natural Language Query Understanding is enabled. + ENABLED = 2 + end + end + # Config to store data store type configuration for workspace data # @!attribute [rw] type # @return [::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig::Type] diff --git a/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb b/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb index bd02908e6f30..c0e47397a834 100644 --- a/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +++ b/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb @@ -42,6 +42,25 @@ module V1 # @!attribute [rw] query # @return [::String] # Raw search query. + # @!attribute [rw] page_categories + # @return [::Array<::String>] + # Optional. The categories associated with a category page. Must be set for + # category navigation queries to achieve good search quality. The format + # should be the same as + # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. + # This field is the equivalent of the query for browse (navigation) queries. + # It's used by the browse model when the query is empty. + # + # If the field is empty, it will not be used by the browse model. + # If the field contains more than one element, only the first element will + # be used. + # + # To represent full path of a category, use '>' character to separate + # different hierarchies. If '>' is part of the category name, replace it with + # other character(s). + # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > + # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 + # > Founders Edition` # @!attribute [rw] image_query # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery] # Raw image query. @@ -76,6 +95,8 @@ module V1 # unset. # # If this field is negative, an `INVALID_ARGUMENT` is returned. + # + # A large offset may be capped to a reasonable threshold. # @!attribute [rw] one_box_page_size # @return [::Integer] # The maximum number of results to return for OneBox. @@ -186,10 +207,10 @@ module V1 # which spell correction takes effect. # @!attribute [rw] user_pseudo_id # @return [::String] - # 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. + # Optional. 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`. # @@ -203,81 +224,10 @@ module V1 # @!attribute [rw] content_search_spec # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec] # A specification for configuring the behavior of content search. - # @!attribute [rw] safe_search - # @return [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - # @!attribute [rw] search_as_you_type_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @!attribute [rw] display_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec] - # Optional. Config for display feature, like match highlighting on search - # results. - # @!attribute [rw] session - # @return [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @!attribute [rw] session_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec] - # Session specification. - # - # Can be used only when `session` is set. - # @!attribute [rw] relevance_threshold - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # This feature is not supported for healthcare search. - # @!attribute [rw] relevance_score_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec] - # Optional. The specification for returning the relevance score. # @!attribute [rw] ranking_expression # @return [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. This overrides + # Optional. The ranking expression controls the customized ranking on + # retrieval documents. This overrides # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. # The syntax and supported features depend on the # `ranking_expression_backend` value. If `ranking_expression_backend` is not @@ -368,7 +318,100 @@ module V1 # * `base_rank`: the default rank of the result # @!attribute [rw] ranking_expression_backend # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # The backend to use for the ranking expression evaluation. + # Optional. The backend to use for the ranking expression evaluation. + # @!attribute [rw] safe_search + # @return [::Boolean] + # Whether to turn on safe search. This is only supported for + # website search. + # @!attribute [rw] user_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # 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. + # @!attribute [rw] natural_language_query_understanding_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec] + # Optional. Config for natural language query understanding capabilities, + # such as extracting structured field filters from the query. Refer to [this + # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) + # for more information. + # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional + # natural language query understanding will be done. + # @!attribute [rw] search_as_you_type_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec] + # Search as you type configuration. Only supported for the + # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} + # vertical. + # @!attribute [rw] display_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec] + # Optional. Config for display feature, like match highlighting on search + # results. + # @!attribute [rw] crowding_specs + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec>] + # Optional. Crowding specifications for improving result diversity. + # If multiple CrowdingSpecs are specified, crowding will be evaluated on + # each unique combination of the `field` values, and max_count will be the + # maximum value of `max_count` across all CrowdingSpecs. + # For example, if the first CrowdingSpec has `field` = "color" and + # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and + # `max_count` = 2, then after 3 documents that share the same color AND size + # have been returned, subsequent ones should be + # removed or demoted. + # @!attribute [rw] session + # @return [::String] + # The session resource name. Optional. + # + # Session allows users to do multi-turn /search API calls or coordination + # between /search API calls and /answer API calls. + # + # Example #1 (multi-turn /search API calls): + # Call /search API with the session ID generated in the first call. + # Here, the previous search query gets considered in query + # standing. I.e., if the first query is "How did Alphabet do in 2022?" + # and the current query is "How about 2023?", the current query will + # be interpreted as "How did Alphabet do in 2023?". + # + # Example #2 (coordination between /search API calls and /answer API calls): + # Call /answer API with the session ID generated in the first call. + # Here, the answer generation happens in the context of the search + # results from the first search call. + # + # Multi-turn Search feature is currently at private GA stage. Please use + # v1alpha or v1beta version instead before we launch this feature to public + # GA. Or ask for allowlisting through Google Support team. + # @!attribute [rw] session_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec] + # Session specification. + # + # Can be used only when `session` is set. + # @!attribute [rw] relevance_threshold + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] + # The global relevance threshold of the search results. + # + # Defaults to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # If more granular relevance filtering is required, use the + # `relevance_filter_spec` instead. + # + # This feature is not supported for healthcare search. + # @!attribute [rw] relevance_score_spec + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec] + # Optional. The specification for returning the relevance score. class SearchRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -391,6 +434,8 @@ class ImageQuery # Required. Full resource name of # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. + # The path must include the project number, project id is not supported for + # this field. # @!attribute [rw] filter # @return [::String] # Optional. Filter specification to filter documents in the data store @@ -430,7 +475,6 @@ class DataStoreSpec # @return [::Array<::String>] # List of keys to exclude when faceting. # - # # By default, # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key FacetKey.key} # is not excluded from the filter unless it is listed in this field. @@ -1025,6 +1069,77 @@ module SearchResultMode end end + # Specification to enable natural language understanding capabilities for + # search requests. + # @!attribute [rw] filter_extraction_condition + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition] + # The condition under which filter extraction should occur. + # Server behavior defaults to `DISABLED`. + # @!attribute [rw] geo_search_query_detection_field_names + # @return [::Array<::String>] + # Field names used for location-based filtering, where geolocation filters + # are detected in natural language search queries. + # Only valid when the FilterExtractionCondition is set to `ENABLED`. + # + # If this field is set, it overrides the field names set in + # [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1.ServingConfig.geo_search_query_detection_field_names]. + # @!attribute [rw] extracted_filter_behavior + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior] + # Optional. Controls behavior of how extracted filters are applied to the + # search. The default behavior depends on the request. For single datastore + # structured search, the default is `HARD_FILTER`. For multi-datastore + # search, the default behavior is `SOFT_BOOST`. + # Location-based filters are always applied as hard filters, and the + # `SOFT_BOOST` setting will not affect them. + # This field is only used if + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition} + # is set to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}. + # @!attribute [rw] allowed_field_names + # @return [::Array<::String>] + # Optional. Allowlist of fields that can be used for natural language + # filter extraction. By default, if this is unspecified, all indexable + # fields are eligible for natural language filter extraction (but are not + # guaranteed to be used). If any fields are specified in + # allowed_field_names, only the fields that are both marked as indexable in + # the schema and specified in the allowlist will be eligible for natural + # language filter extraction. Note: for multi-datastore search, this is not + # yet supported, and will be ignored. + class NaturalLanguageQueryUnderstandingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing under which condition filter extraction should occur. + module FilterExtractionCondition + # Server behavior defaults to `DISABLED`. + CONDITION_UNSPECIFIED = 0 + + # Disables NL filter extraction. + DISABLED = 1 + + # Enables NL filter extraction. + ENABLED = 2 + end + + # Enum describing how extracted filters are applied to the search. + module ExtractedFilterBehavior + # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior + # for extracted filters. For single datastore search, the default is to + # apply as hard filters. For multi-datastore search, the default is to + # apply as soft boosts. + EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0 + + # Applies all extracted filters as hard filters on the results. Results + # that do not pass the extracted filters will not be returned in the + # result set. + HARD_FILTER = 1 + + # Applies all extracted filters as soft boosts. Results that pass the + # filters will be boosted up to higher ranks in the result set. + SOFT_BOOST = 2 + end + end + # Specification for search as you type in search requests. # @!attribute [rw] condition # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition] @@ -1074,6 +1189,45 @@ module MatchHighlightingCondition end end + # Specification for crowding. Crowding improves the diversity of search + # results by limiting the number of results that share the same field value. + # For example, crowding on the color field with a max_count of 3 and mode + # DROP_CROWDED_RESULTS will return at most 3 results with the same color + # across all pages. + # @!attribute [rw] field + # @return [::String] + # The field to use for crowding. Documents can be crowded by a field in the + # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. Crowding + # field is case sensitive. + # @!attribute [rw] max_count + # @return [::Integer] + # The maximum number of documents to keep per value of the field. Once + # there are at least max_count previous results which contain the same + # value for the given field (according to the order specified in + # `order_by`), later results with the same value are "crowded away". + # If not specified, the default value is 1. + # @!attribute [rw] mode + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode] + # Mode to use for documents that are crowded away. + class CrowdingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum describing the mode to use for documents that are crowded away. + # They can be dropped or demoted to the later pages. + module Mode + # Unspecified crowding mode. In this case, server behavior defaults to + # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}. + MODE_UNSPECIFIED = 0 + + # Drop crowded results. + DROP_CROWDED_RESULTS = 1 + + # Demote crowded results to the later pages. + DEMOTE_CROWDED_RESULTS_TO_END = 2 + end + end + # Session specification. # # Multi-turn Search feature is currently at private GA stage. Please use @@ -1148,6 +1302,30 @@ class UserLabelsEntry extend ::Google::Protobuf::MessageExts::ClassMethods end + # The backend to use for the ranking expression evaluation. + module RankingExpressionBackend + # Default option for unspecified/unknown values. + RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0 + + # Deprecated: Use `RANK_BY_EMBEDDING` instead. + # Ranking by custom embedding model, the default way to evaluate the + # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be + # used instead. + BYOE = 1 + + # Deprecated: Use `RANK_BY_FORMULA` instead. + # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should + # be used instead. + CLEARBOX = 2 + + # Ranking by custom embedding model, the default way to evaluate the + # ranking expression. + RANK_BY_EMBEDDING = 3 + + # Ranking by custom formula. + RANK_BY_FORMULA = 4 + end + # The relevance threshold of the search results. The higher relevance # threshold is, the higher relevant results are shown and the less number of # results are returned. @@ -1168,19 +1346,6 @@ module RelevanceThreshold # High relevance threshold. HIGH = 4 end - - # The backend to use for the ranking expression evaluation. - module RankingExpressionBackend - # Default option for unspecified/unknown values. - RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0 - - # Ranking by custom embedding model, the default way to evaluate the - # ranking expression. - RANK_BY_EMBEDDING = 3 - - # Ranking by custom formula. - RANK_BY_FORMULA = 4 - end end # Response message for @@ -1234,6 +1399,10 @@ module RankingExpressionBackend # @!attribute [rw] query_expansion_info # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo] # Query expansion information for the returned results. + # @!attribute [r] natural_language_query_understanding_info + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo] + # Output only. Natural language query understanding information for the + # returned results. # @!attribute [rw] session_info # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo] # Session information. @@ -1244,6 +1413,9 @@ module RankingExpressionBackend # @!attribute [rw] search_link_promotions # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion>] # Promotions for site search. + # @!attribute [r] semantic_state + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SemanticState] + # Output only. Indicates the semantic state of the search response. class SearchResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1268,48 +1440,39 @@ class SearchResponse # Output only. Google provided available scores. # @!attribute [rw] rank_signals # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals] - # A set of ranking signals associated with the result. + # Optional. A set of ranking signals associated with the result. class SearchResult include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList] - class ModelScoresEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - # A set of ranking signals. # @!attribute [rw] keyword_similarity_score # @return [::Float] - # Keyword matching adjustment. + # Optional. Keyword matching adjustment. # @!attribute [rw] relevance_score # @return [::Float] - # Semantic relevance adjustment. + # Optional. Semantic relevance adjustment. # @!attribute [rw] semantic_similarity_score # @return [::Float] - # Semantic similarity adjustment. + # Optional. Semantic similarity adjustment. # @!attribute [rw] pctr_rank # @return [::Float] - # Predicted conversion rate adjustment as a rank. + # Optional. Predicted conversion rate adjustment as a rank. # @!attribute [rw] topicality_rank # @return [::Float] - # Topicality adjustment as a rank. + # Optional. Topicality adjustment as a rank. # @!attribute [rw] document_age # @return [::Float] - # Age of the document in hours. + # Optional. Age of the document in hours. # @!attribute [rw] boosting_factor # @return [::Float] - # Combined custom boosts for a doc. + # Optional. Combined custom boosts for a doc. # @!attribute [rw] default_rank # @return [::Float] - # The default rank of the result. + # Optional. The default rank of the result. # @!attribute [rw] custom_signals # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>] - # A list of custom clearbox signals. + # Optional. A list of custom clearbox signals. class RankSignals include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1317,15 +1480,25 @@ class RankSignals # Custom clearbox signal represented by name and value pair. # @!attribute [rw] name # @return [::String] - # Name of the signal. + # Optional. Name of the signal. # @!attribute [rw] value # @return [::Float] - # Float value representing the ranking signal (e.g. 1.25 for BM25). + # Optional. Float value representing the ranking signal (e.g. 1.25 for + # BM25). class CustomSignal include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList] + class ModelScoresEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # A facet result. @@ -1570,6 +1743,171 @@ class QueryExpansionInfo extend ::Google::Protobuf::MessageExts::ClassMethods end + # Information describing what natural language understanding was + # done on the input query. + # @!attribute [rw] extracted_filters + # @return [::String] + # The filters that were extracted from the input query. + # @!attribute [rw] rewritten_query + # @return [::String] + # Rewritten input query minus the extracted filters. + # @!attribute [rw] classified_intents + # @return [::Array<::String>] + # The classified intents from the input query. + # @!attribute [rw] structured_extracted_filter + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter] + # The filters that were extracted from the input query represented in a + # structured form. + class NaturalLanguageQueryUnderstandingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The filters that were extracted from the input query represented in a + # structured form. + # @!attribute [rw] expression + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression] + # The expression denoting the filter that was extracted from the input + # query in a structured form. It can be a simple expression denoting a + # single string, numerical or geolocation constraint or a compound + # expression which is a combination of multiple expressions connected + # using logical (OR and AND) operators. + class StructuredExtractedFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Constraint expression of a string field. + # @!attribute [rw] field_name + # @return [::String] + # Name of the string field as defined in the schema. + # @!attribute [rw] values + # @return [::Array<::String>] + # Values of the string field. The record will only be returned if the + # field value matches one of the values specified here. + # @!attribute [rw] query_segment + # @return [::String] + # Identifies the keywords within the search query that match a filter. + class StringConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Constraint expression of a number field. Example: price < 100. + # @!attribute [rw] field_name + # @return [::String] + # Name of the numerical field as defined in the schema. + # @!attribute [rw] comparison + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison] + # The comparison operation performed between the field value and the + # value specified in the constraint. + # @!attribute [rw] value + # @return [::Float] + # The value specified in the numerical constraint. + # @!attribute [rw] query_segment + # @return [::String] + # Identifies the keywords within the search query that match a filter. + class NumberConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The comparison operation that was performed. + module Comparison + # Undefined comparison operator. + COMPARISON_UNSPECIFIED = 0 + + # Denotes equality `=` operator. + EQUALS = 1 + + # Denotes less than or equal to `<=` operator. + LESS_THAN_EQUALS = 2 + + # Denotes less than `<` operator. + LESS_THAN = 3 + + # Denotes greater than or equal to `>=` operator. + GREATER_THAN_EQUALS = 4 + + # Denotes greater than `>` operator. + GREATER_THAN = 5 + end + end + + # Constraint of a geolocation field. + # Name of the geolocation field as defined in the schema. + # @!attribute [rw] field_name + # @return [::String] + # The name of the geolocation field as defined in the schema. + # @!attribute [rw] address + # @return [::String] + # The reference address that was inferred from the input query. The + # proximity of the reference address to the geolocation field will be + # used to filter the results. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude of the geolocation inferred from the input query. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude of the geolocation inferred from the input query. + # @!attribute [rw] radius_in_meters + # @return [::Float] + # The radius in meters around the address. The record is returned if + # the location of the geolocation field is within the radius. + class GeolocationConstraint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical `And` operator. + # @!attribute [rw] expressions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] + # The expressions that were ANDed together. + class AndExpression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical `Or` operator. + # @!attribute [rw] expressions + # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] + # The expressions that were ORed together. + class OrExpression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The expression denoting the filter that was extracted from the input + # query. + # @!attribute [rw] string_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint] + # String constraint expression. + # + # Note: The following fields are mutually exclusive: `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint] + # Numerical constraint expression. + # + # Note: The following fields are mutually exclusive: `number_constraint`, `string_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] geolocation_constraint + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint] + # Geolocation constraint expression. + # + # Note: The following fields are mutually exclusive: `geolocation_constraint`, `string_constraint`, `number_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] and_expr + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression] + # Logical "And" compound operator connecting multiple expressions. + # + # Note: The following fields are mutually exclusive: `and_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] or_expr + # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression] + # Logical "Or" compound operator connecting multiple expressions. + # + # Note: The following fields are mutually exclusive: `or_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Expression + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + # Information about the session. # @!attribute [rw] name # @return [::String] @@ -1589,6 +1927,18 @@ class SessionInfo include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Semantic state of the search response. + module SemanticState + # Default value. Should not be used. + SEMANTIC_STATE_UNSPECIFIED = 0 + + # Semantic search was disabled for this search response. + DISABLED = 1 + + # Semantic search was enabled for this search response. + ENABLED = 2 + end end end end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb index 7a1f71d31c6f..ee92bdfe0c7a 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb @@ -89,6 +89,7 @@ def test_search serving_config = "hello world" branch = "hello world" query = "hello world" + page_categories = ["hello world"] image_query = {} page_size = 42 page_token = "hello world" @@ -107,16 +108,18 @@ def test_search spell_correction_spec = {} user_pseudo_id = "hello world" content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED safe_search = true user_labels = {} + natural_language_query_understanding_spec = {} search_as_you_type_spec = {} display_spec = {} + crowding_specs = [{}] session = "hello world" session_spec = {} relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED relevance_score_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -132,27 +135,27 @@ def test_search end # Use hash object - client.search({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }) do |_result, response| + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.search serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend do |_result, response| + client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend) do |_result, response| + client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.search({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }, call_options) do |_result, response| + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend), call_options) do |_result, response| + client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| assert_equal http_response, response.underlying_op end @@ -173,6 +176,7 @@ def test_search_lite serving_config = "hello world" branch = "hello world" query = "hello world" + page_categories = ["hello world"] image_query = {} page_size = 42 page_token = "hello world" @@ -191,16 +195,18 @@ def test_search_lite spell_correction_spec = {} user_pseudo_id = "hello world" content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED safe_search = true user_labels = {} + natural_language_query_understanding_spec = {} search_as_you_type_spec = {} display_spec = {} + crowding_specs = [{}] session = "hello world" session_spec = {} relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED relevance_score_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED search_lite_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -216,27 +222,27 @@ def test_search_lite end # Use hash object - client.search_lite({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }) do |_result, response| + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.search_lite serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend do |_result, response| + client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend) do |_result, response| + client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.search_lite({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }, call_options) do |_result, response| + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend), call_options) do |_result, response| + client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| assert_equal http_response, response.underlying_op end diff --git a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb index ae0a5f96d220..c07426470386 100644 --- a/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb +++ b/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb @@ -74,6 +74,7 @@ def test_search serving_config = "hello world" branch = "hello world" query = "hello world" + page_categories = ["hello world"] image_query = {} page_size = 42 page_token = "hello world" @@ -92,16 +93,18 @@ def test_search spell_correction_spec = {} user_pseudo_id = "hello world" content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED safe_search = true user_labels = {} + natural_language_query_understanding_spec = {} search_as_you_type_spec = {} display_spec = {} + crowding_specs = [{}] session = "hello world" session_spec = {} relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED relevance_score_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :search, name @@ -109,6 +112,7 @@ def test_search assert_equal "hello world", request["serving_config"] assert_equal "hello world", request["branch"] assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["page_categories"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] assert_equal 42, request["page_size"] assert_equal "hello world", request["page_token"] @@ -127,16 +131,18 @@ def test_search assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] assert_equal "hello world", request["user_pseudo_id"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] + assert_equal "hello world", request["ranking_expression"] + assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] assert_equal true, request["safe_search"] assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first assert_equal "hello world", request["session"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] - assert_equal "hello world", request["ranking_expression"] - assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] refute_nil options end @@ -147,35 +153,35 @@ def test_search end # Use hash object - client.search({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }) do |response, operation| + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use named arguments - client.search serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend do |response, operation| + client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object - client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend) do |response, operation| + client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use hash object with options - client.search({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }, grpc_options) do |response, operation| + client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object with options - client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend), grpc_options) do |response, operation| + client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation @@ -197,6 +203,7 @@ def test_search_lite serving_config = "hello world" branch = "hello world" query = "hello world" + page_categories = ["hello world"] image_query = {} page_size = 42 page_token = "hello world" @@ -215,16 +222,18 @@ def test_search_lite spell_correction_spec = {} user_pseudo_id = "hello world" content_search_spec = {} + ranking_expression = "hello world" + ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED safe_search = true user_labels = {} + natural_language_query_understanding_spec = {} search_as_you_type_spec = {} display_spec = {} + crowding_specs = [{}] session = "hello world" session_spec = {} relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED relevance_score_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED search_lite_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :search_lite, name @@ -232,6 +241,7 @@ def test_search_lite assert_equal "hello world", request["serving_config"] assert_equal "hello world", request["branch"] assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["page_categories"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] assert_equal 42, request["page_size"] assert_equal "hello world", request["page_token"] @@ -250,16 +260,18 @@ def test_search_lite assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] assert_equal "hello world", request["user_pseudo_id"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] + assert_equal "hello world", request["ranking_expression"] + assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] assert_equal true, request["safe_search"] assert_equal({}, request["user_labels"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] + assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first assert_equal "hello world", request["session"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] - assert_equal "hello world", request["ranking_expression"] - assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] refute_nil options end @@ -270,35 +282,35 @@ def test_search_lite end # Use hash object - client.search_lite({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }) do |response, operation| + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use named arguments - client.search_lite serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend do |response, operation| + client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object - client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend) do |response, operation| + client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use hash object with options - client.search_lite({ serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend }, grpc_options) do |response, operation| + client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object with options - client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, safe_search: safe_search, user_labels: user_labels, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend), grpc_options) do |response, operation| + client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore b/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json deleted file mode 100644 index 7f14e6eef777..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "discoveryengine.googleapis.com", - "api_shortname": "discoveryengine", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest", - "distribution_name": "google-cloud-discovery_engine-v1", - "is_cloud": true, - "language": "ruby", - "name": "discoveryengine", - "name_pretty": "Discovery Engine V1 API", - "product_documentation": "https://cloud.google.com/generative-ai-app-builder/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Discovery Engine API. Note that google-cloud-discovery_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-discovery_engine instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/generative-ai-app-builder/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml b/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml deleted file mode 100644 index 56b31de04a6d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-discovery_engine-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-discovery_engine-v1.rb" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts b/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts deleted file mode 100644 index 926c10b3d6c0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Discovery Engine V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md deleted file mode 100644 index 9cc4fc80271b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-discovery_engine-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-discovery_engine-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/discovery_engine/v1" - -client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/discovery_engine/v1" - -::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-discovery_engine-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/discovery_engine/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile b/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md b/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.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. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/README.md b/owl-bot-staging/google-cloud-discovery_engine-v1/README.md deleted file mode 100644 index 923b5e4740b1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Discovery Engine V1 API - -Discovery Engine API. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Discovery Engine V1 API. Most users should consider using -the main client gem, -[google-cloud-discovery_engine](https://rubygems.org/gems/google-cloud-discovery_engine). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-discovery_engine-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/discoveryengine.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/discovery_engine/v1" - -client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new -request = ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new # (request fields as keyword arguments...) -response = client.search request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/generative-ai-app-builder/docs) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/discovery_engine/v1" -require "logger" - -client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-discovery_engine`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-discovery_engine-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-discovery_engine`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-discovery_engine-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile b/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile deleted file mode 100644 index 38d5c794195b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-discovery_engine-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/discovery_engine/v1/search_service/credentials" - ::Google::Cloud::DiscoveryEngine::V1::SearchService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-discovery_engine-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-discovery_engine-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-discovery_engine-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-discovery_engine-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-discovery_engine-v1" - header "google-cloud-discovery_engine-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-discovery_engine-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-discovery_engine-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-discovery_engine-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-discovery_engine-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json deleted file mode 100644 index 98ebe5c969da..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/gapic_metadata.json +++ /dev/null @@ -1,678 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.discoveryengine.v1", - "libraryPackage": "::Google::Cloud::DiscoveryEngine::V1", - "services": { - "SearchService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client", - "rpcs": { - "Search": { - "methods": [ - "search" - ] - }, - "SearchLite": { - "methods": [ - "search_lite" - ] - } - } - } - } - }, - "AssistantService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client", - "rpcs": { - "StreamAssist": { - "methods": [ - "stream_assist" - ] - } - } - } - } - }, - "CmekConfigService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client", - "rpcs": { - "UpdateCmekConfig": { - "methods": [ - "update_cmek_config" - ] - }, - "GetCmekConfig": { - "methods": [ - "get_cmek_config" - ] - }, - "ListCmekConfigs": { - "methods": [ - "list_cmek_configs" - ] - }, - "DeleteCmekConfig": { - "methods": [ - "delete_cmek_config" - ] - } - } - } - } - }, - "CompletionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client", - "rpcs": { - "CompleteQuery": { - "methods": [ - "complete_query" - ] - }, - "ImportSuggestionDenyListEntries": { - "methods": [ - "import_suggestion_deny_list_entries" - ] - }, - "PurgeSuggestionDenyListEntries": { - "methods": [ - "purge_suggestion_deny_list_entries" - ] - }, - "ImportCompletionSuggestions": { - "methods": [ - "import_completion_suggestions" - ] - }, - "PurgeCompletionSuggestions": { - "methods": [ - "purge_completion_suggestions" - ] - } - } - } - } - }, - "ControlService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client", - "rpcs": { - "CreateControl": { - "methods": [ - "create_control" - ] - }, - "DeleteControl": { - "methods": [ - "delete_control" - ] - }, - "UpdateControl": { - "methods": [ - "update_control" - ] - }, - "GetControl": { - "methods": [ - "get_control" - ] - }, - "ListControls": { - "methods": [ - "list_controls" - ] - } - } - } - } - }, - "ConversationalSearchService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client", - "rpcs": { - "ConverseConversation": { - "methods": [ - "converse_conversation" - ] - }, - "CreateConversation": { - "methods": [ - "create_conversation" - ] - }, - "DeleteConversation": { - "methods": [ - "delete_conversation" - ] - }, - "UpdateConversation": { - "methods": [ - "update_conversation" - ] - }, - "GetConversation": { - "methods": [ - "get_conversation" - ] - }, - "ListConversations": { - "methods": [ - "list_conversations" - ] - }, - "AnswerQuery": { - "methods": [ - "answer_query" - ] - }, - "StreamAnswerQuery": { - "methods": [ - "stream_answer_query" - ] - }, - "GetAnswer": { - "methods": [ - "get_answer" - ] - }, - "CreateSession": { - "methods": [ - "create_session" - ] - }, - "DeleteSession": { - "methods": [ - "delete_session" - ] - }, - "UpdateSession": { - "methods": [ - "update_session" - ] - }, - "GetSession": { - "methods": [ - "get_session" - ] - }, - "ListSessions": { - "methods": [ - "list_sessions" - ] - } - } - } - } - }, - "DataStoreService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client", - "rpcs": { - "CreateDataStore": { - "methods": [ - "create_data_store" - ] - }, - "GetDataStore": { - "methods": [ - "get_data_store" - ] - }, - "ListDataStores": { - "methods": [ - "list_data_stores" - ] - }, - "DeleteDataStore": { - "methods": [ - "delete_data_store" - ] - }, - "UpdateDataStore": { - "methods": [ - "update_data_store" - ] - } - } - } - } - }, - "DocumentService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client", - "rpcs": { - "GetDocument": { - "methods": [ - "get_document" - ] - }, - "ListDocuments": { - "methods": [ - "list_documents" - ] - }, - "CreateDocument": { - "methods": [ - "create_document" - ] - }, - "UpdateDocument": { - "methods": [ - "update_document" - ] - }, - "DeleteDocument": { - "methods": [ - "delete_document" - ] - }, - "ImportDocuments": { - "methods": [ - "import_documents" - ] - }, - "PurgeDocuments": { - "methods": [ - "purge_documents" - ] - }, - "BatchGetDocumentsMetadata": { - "methods": [ - "batch_get_documents_metadata" - ] - } - } - } - } - }, - "EngineService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client", - "rpcs": { - "CreateEngine": { - "methods": [ - "create_engine" - ] - }, - "DeleteEngine": { - "methods": [ - "delete_engine" - ] - }, - "UpdateEngine": { - "methods": [ - "update_engine" - ] - }, - "GetEngine": { - "methods": [ - "get_engine" - ] - }, - "ListEngines": { - "methods": [ - "list_engines" - ] - } - } - } - } - }, - "GroundedGenerationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client", - "rpcs": { - "StreamGenerateGroundedContent": { - "methods": [ - "stream_generate_grounded_content" - ] - }, - "GenerateGroundedContent": { - "methods": [ - "generate_grounded_content" - ] - }, - "CheckGrounding": { - "methods": [ - "check_grounding" - ] - } - } - } - } - }, - "IdentityMappingStoreService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client", - "rpcs": { - "CreateIdentityMappingStore": { - "methods": [ - "create_identity_mapping_store" - ] - }, - "GetIdentityMappingStore": { - "methods": [ - "get_identity_mapping_store" - ] - }, - "DeleteIdentityMappingStore": { - "methods": [ - "delete_identity_mapping_store" - ] - }, - "ImportIdentityMappings": { - "methods": [ - "import_identity_mappings" - ] - }, - "PurgeIdentityMappings": { - "methods": [ - "purge_identity_mappings" - ] - }, - "ListIdentityMappings": { - "methods": [ - "list_identity_mappings" - ] - }, - "ListIdentityMappingStores": { - "methods": [ - "list_identity_mapping_stores" - ] - } - } - } - } - }, - "ProjectService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client", - "rpcs": { - "ProvisionProject": { - "methods": [ - "provision_project" - ] - } - } - } - } - }, - "RankService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client", - "rpcs": { - "Rank": { - "methods": [ - "rank" - ] - } - } - } - } - }, - "RecommendationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client", - "rpcs": { - "Recommend": { - "methods": [ - "recommend" - ] - } - } - } - } - }, - "SchemaService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client", - "rpcs": { - "GetSchema": { - "methods": [ - "get_schema" - ] - }, - "ListSchemas": { - "methods": [ - "list_schemas" - ] - }, - "CreateSchema": { - "methods": [ - "create_schema" - ] - }, - "UpdateSchema": { - "methods": [ - "update_schema" - ] - }, - "DeleteSchema": { - "methods": [ - "delete_schema" - ] - } - } - } - } - }, - "SearchTuningService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client", - "rpcs": { - "TrainCustomModel": { - "methods": [ - "train_custom_model" - ] - }, - "ListCustomModels": { - "methods": [ - "list_custom_models" - ] - } - } - } - } - }, - "ServingConfigService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client", - "rpcs": { - "UpdateServingConfig": { - "methods": [ - "update_serving_config" - ] - } - } - } - } - }, - "SessionService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client", - "rpcs": { - "CreateSession": { - "methods": [ - "create_session" - ] - }, - "DeleteSession": { - "methods": [ - "delete_session" - ] - }, - "UpdateSession": { - "methods": [ - "update_session" - ] - }, - "GetSession": { - "methods": [ - "get_session" - ] - }, - "ListSessions": { - "methods": [ - "list_sessions" - ] - } - } - } - } - }, - "SiteSearchEngineService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client", - "rpcs": { - "GetSiteSearchEngine": { - "methods": [ - "get_site_search_engine" - ] - }, - "CreateTargetSite": { - "methods": [ - "create_target_site" - ] - }, - "BatchCreateTargetSites": { - "methods": [ - "batch_create_target_sites" - ] - }, - "GetTargetSite": { - "methods": [ - "get_target_site" - ] - }, - "UpdateTargetSite": { - "methods": [ - "update_target_site" - ] - }, - "DeleteTargetSite": { - "methods": [ - "delete_target_site" - ] - }, - "ListTargetSites": { - "methods": [ - "list_target_sites" - ] - }, - "CreateSitemap": { - "methods": [ - "create_sitemap" - ] - }, - "DeleteSitemap": { - "methods": [ - "delete_sitemap" - ] - }, - "FetchSitemaps": { - "methods": [ - "fetch_sitemaps" - ] - }, - "EnableAdvancedSiteSearch": { - "methods": [ - "enable_advanced_site_search" - ] - }, - "DisableAdvancedSiteSearch": { - "methods": [ - "disable_advanced_site_search" - ] - }, - "RecrawlUris": { - "methods": [ - "recrawl_uris" - ] - }, - "BatchVerifyTargetSites": { - "methods": [ - "batch_verify_target_sites" - ] - }, - "FetchDomainVerificationStatus": { - "methods": [ - "fetch_domain_verification_status" - ] - } - } - } - } - }, - "UserEventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client", - "rpcs": { - "WriteUserEvent": { - "methods": [ - "write_user_event" - ] - }, - "CollectUserEvent": { - "methods": [ - "collect_user_event" - ] - }, - "PurgeUserEvents": { - "methods": [ - "purge_user_events" - ] - }, - "ImportUserEvents": { - "methods": [ - "import_user_events" - ] - } - } - } - } - }, - "UserLicenseService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client", - "rpcs": { - "ListUserLicenses": { - "methods": [ - "list_user_licenses" - ] - }, - "BatchUpdateUserLicenses": { - "methods": [ - "batch_update_user_licenses" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec b/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec deleted file mode 100644 index 94dabc53a975..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/discovery_engine/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-discovery_engine-v1" - gem.version = Google::Cloud::DiscoveryEngine::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Discovery Engine API. Note that google-cloud-discovery_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-discovery_engine instead. See the readme for more details." - gem.summary = "Discovery Engine API." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb deleted file mode 100644 index 8fa7d6941140..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google-cloud-discovery_engine-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/discovery_engine/v1" diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb deleted file mode 100644 index f81fdab2d80f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discovery_engine/v1/search_service" -require "google/cloud/discovery_engine/v1/assistant_service" -require "google/cloud/discovery_engine/v1/cmek_config_service" -require "google/cloud/discovery_engine/v1/completion_service" -require "google/cloud/discovery_engine/v1/control_service" -require "google/cloud/discovery_engine/v1/conversational_search_service" -require "google/cloud/discovery_engine/v1/data_store_service" -require "google/cloud/discovery_engine/v1/document_service" -require "google/cloud/discovery_engine/v1/engine_service" -require "google/cloud/discovery_engine/v1/grounded_generation_service" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service" -require "google/cloud/discovery_engine/v1/project_service" -require "google/cloud/discovery_engine/v1/rank_service" -require "google/cloud/discovery_engine/v1/recommendation_service" -require "google/cloud/discovery_engine/v1/schema_service" -require "google/cloud/discovery_engine/v1/search_tuning_service" -require "google/cloud/discovery_engine/v1/serving_config_service" -require "google/cloud/discovery_engine/v1/session_service" -require "google/cloud/discovery_engine/v1/site_search_engine_service" -require "google/cloud/discovery_engine/v1/user_event_service" -require "google/cloud/discovery_engine/v1/user_license_service" -require "google/cloud/discovery_engine/v1/version" - -module Google - module Cloud - module DiscoveryEngine - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/discovery_engine/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb deleted file mode 100644 index 65a0bb155463..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/assistant_service/credentials" -require "google/cloud/discovery_engine/v1/assistant_service/paths" -require "google/cloud/discovery_engine/v1/assistant_service/client" -require "google/cloud/discovery_engine/v1/assistant_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Assistant configuration and assisting users. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/assistant_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/assistant_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new - # - module AssistantService - end - end - end - end -end - -helper_path = ::File.join __dir__, "assistant_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/assistant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb deleted file mode 100644 index 6be46b957151..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/client.rb +++ /dev/null @@ -1,526 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/assistant_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - ## - # Client for the AssistantService service. - # - # Service for managing Assistant configuration and assisting users. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :assistant_service_stub - - ## - # Configure the AssistantService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AssistantService clients - # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.stream_assist.timeout = 300.0 - default_config.rpcs.stream_assist.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AssistantService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @assistant_service_stub.universe_domain - end - - ## - # Create a new AssistantService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AssistantService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/assistant_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @assistant_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @assistant_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @assistant_service_stub.endpoint - config.universe_domain = @assistant_service_stub.universe_domain - config.logger = @assistant_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @assistant_service_stub.logger - end - - # Service calls - - ## - # Assists the user with a query in a streaming fashion. - # - # @overload stream_assist(request, options = nil) - # Pass arguments to `stream_assist` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) - # Pass arguments to `stream_assist` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Optional. Current user query. - # - # Empty query is only supported if `file_ids` are provided. In this case, the - # answer will be generated based on those context files. - # @param session [::String] - # Optional. The session to use for the request. If specified, the assistant - # has access to the session history, and the query and the answer are stored - # there. - # - # If `-` is specified as the session ID, or it is left empty, then a new - # session is created with an automatically generated ID. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # @param user_metadata [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata, ::Hash] - # Optional. Information about the user initiating the query. - # @param tools_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec, ::Hash] - # Optional. Specification of tools that are used to serve the request. - # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec, ::Hash] - # Optional. Specification of the generation configuration for the request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new - # - # # Call the stream_assist method to start streaming. - # output = client.stream_assist request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse - # output.each do |current_response| - # p current_response - # end - # - def stream_assist request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.stream_assist.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.stream_assist.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stream_assist.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @assistant_service_stub.call_rpc :stream_assist, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AssistantService API. - # - # This class represents the configuration for AssistantService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # stream_assist to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.stream_assist.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.stream_assist.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AssistantService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `stream_assist` - # @return [::Gapic::Config::Method] - # - attr_reader :stream_assist - - # @private - def initialize parent_rpcs = nil - stream_assist_config = parent_rpcs.stream_assist if parent_rpcs.respond_to? :stream_assist - @stream_assist = ::Gapic::Config::Method.new stream_assist_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb deleted file mode 100644 index 65627bcdd468..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - # Credentials for the AssistantService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb deleted file mode 100644 index fb4f8ab81803..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/paths.rb +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - # Path helper methods for the AssistantService API. - module Paths - ## - # Create a fully-qualified Assistant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param assistant [String] - # - # @return [::String] - def assistant_path project:, location:, collection:, engine:, assistant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/assistants/#{assistant}" - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, engine:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb deleted file mode 100644 index a576a15accd0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/assistant_service/credentials" -require "google/cloud/discovery_engine/v1/assistant_service/paths" -require "google/cloud/discovery_engine/v1/assistant_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Assistant configuration and assisting users. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/assistant_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new - # - module AssistantService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/assistant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb deleted file mode 100644 index 764caa95d50d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/client.rb +++ /dev/null @@ -1,478 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/assistant_service_pb" -require "google/cloud/discovery_engine/v1/assistant_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - module Rest - ## - # REST client for the AssistantService service. - # - # Service for managing Assistant configuration and assisting users. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :assistant_service_stub - - ## - # Configure the AssistantService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AssistantService clients - # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.stream_assist.timeout = 300.0 - default_config.rpcs.stream_assist.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AssistantService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @assistant_service_stub.universe_domain - end - - ## - # Create a new AssistantService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AssistantService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @assistant_service_stub = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @assistant_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @assistant_service_stub.endpoint - config.universe_domain = @assistant_service_stub.universe_domain - config.logger = @assistant_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @assistant_service_stub.logger - end - - # Service calls - - ## - # Assists the user with a query in a streaming fashion. - # - # @overload stream_assist(request, options = nil) - # Pass arguments to `stream_assist` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stream_assist(name: nil, query: nil, session: nil, user_metadata: nil, tools_spec: nil, generation_spec: nil) - # Pass arguments to `stream_assist` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Optional. Current user query. - # - # Empty query is only supported if `file_ids` are provided. In this case, the - # answer will be generated based on those context files. - # @param session [::String] - # Optional. The session to use for the request. If specified, the assistant - # has access to the session history, and the query and the answer are stored - # there. - # - # If `-` is specified as the session ID, or it is left empty, then a new - # session is created with an automatically generated ID. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # @param user_metadata [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata, ::Hash] - # Optional. Information about the user initiating the query. - # @param tools_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec, ::Hash] - # Optional. Specification of tools that are used to serve the request. - # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec, ::Hash] - # Optional. Specification of the generation configuration for the request. - # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new - # - # # Call the stream_assist method to start streaming. - # output = client.stream_assist request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse - # output.each do |current_response| - # p current_response - # end - # - def stream_assist request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.stream_assist.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.stream_assist.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stream_assist.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @assistant_service_stub.stream_assist request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AssistantService REST API. - # - # This class represents the configuration for AssistantService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # stream_assist to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.stream_assist.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.stream_assist.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the AssistantService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `stream_assist` - # @return [::Gapic::Config::Method] - # - attr_reader :stream_assist - - # @private - def initialize parent_rpcs = nil - stream_assist_config = parent_rpcs.stream_assist if parent_rpcs.respond_to? :stream_assist - @stream_assist = ::Gapic::Config::Method.new stream_assist_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb deleted file mode 100644 index 9bbf582985b5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/assistant_service/rest/service_stub.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/assistant_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - module Rest - ## - # REST service stub for the AssistantService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the stream_assist REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def stream_assist(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stream_assist_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "stream_assist", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # @private - # - # GRPC transcoding helper method for the stream_assist REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stream_assist_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:streamAssist", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/assistants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb deleted file mode 100644 index 15a50496836b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/cmek_config_service/credentials" -require "google/cloud/discovery_engine/v1/cmek_config_service/paths" -require "google/cloud/discovery_engine/v1/cmek_config_service/operations" -require "google/cloud/discovery_engine/v1/cmek_config_service/client" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing CMEK related tasks - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/cmek_config_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/cmek_config_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - module CmekConfigService - end - end - end - end -end - -helper_path = ::File.join __dir__, "cmek_config_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/cmek_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb deleted file mode 100644 index a4d24b2e71f1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb +++ /dev/null @@ -1,820 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - ## - # Client for the CmekConfigService service. - # - # Service for managing CMEK related tasks - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cmek_config_service_stub - - ## - # Configure the CmekConfigService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CmekConfigService clients - # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CmekConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cmek_config_service_stub.universe_domain - end - - ## - # Create a new CmekConfigService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CmekConfigService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/cmek_config_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cmek_config_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @cmek_config_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cmek_config_service_stub.endpoint - config.universe_domain = @cmek_config_service_stub.universe_domain - config.logger = @cmek_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cmek_config_service_stub.logger - end - - # Service calls - - ## - # Provisions a CMEK key for use in a location of a customer's project. - # This method will also conduct location validation on the provided - # cmekConfig to make sure the key is valid and can be used in the - # selected location. - # - # @overload update_cmek_config(request, options = nil) - # Pass arguments to `update_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_cmek_config(config: nil, set_default: nil) - # Pass arguments to `update_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::DiscoveryEngine::V1::CmekConfig, ::Hash] - # Required. The CmekConfig resource. - # @param set_default [::Boolean] - # Set the following CmekConfig as the default to be used for child - # resources if one is not specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new - # - # # Call the update_cmek_config method. - # result = client.update_cmek_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.config&.name - header_params["config.name"] = request.config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.call_rpc :update_cmek_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}. - # - # @overload get_cmek_config(request, options = nil) - # Pass arguments to `get_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cmek_config(name: nil) - # Pass arguments to `get_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as - # `projects/*/locations/*/cmekConfig` or - # `projects/*/locations/*/cmekConfigs/*`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new - # - # # Call the get_cmek_config method. - # result = client.get_cmek_config request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. - # p result - # - def get_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.call_rpc :get_cmek_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s - # with the project. - # - # @overload list_cmek_configs(request, options = nil) - # Pass arguments to `list_cmek_configs` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_cmek_configs(parent: nil) - # Pass arguments to `list_cmek_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent location resource name, such as - # `projects/{project}/locations/{location}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this - # location, regardless of whether or not a CmekConfig exists, a - # PERMISSION_DENIED error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new - # - # # Call the list_cmek_configs method. - # result = client.list_cmek_configs request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. - # p result - # - def list_cmek_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_cmek_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_cmek_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_cmek_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.call_rpc :list_cmek_configs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # De-provisions a CmekConfig. - # - # @overload delete_cmek_config(request, options = nil) - # Pass arguments to `delete_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_cmek_config(name: nil) - # Pass arguments to `delete_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new - # - # # Call the delete_cmek_config method. - # result = client.delete_cmek_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_cmek_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.call_rpc :delete_cmek_config, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CmekConfigService API. - # - # This class represents the configuration for CmekConfigService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_cmek_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_cmek_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_cmek_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CmekConfigService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cmek_config - ## - # RPC-specific configuration for `get_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cmek_config - ## - # RPC-specific configuration for `list_cmek_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cmek_configs - ## - # RPC-specific configuration for `delete_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cmek_config - - # @private - def initialize parent_rpcs = nil - update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config - @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config - get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config - @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config - list_cmek_configs_config = parent_rpcs.list_cmek_configs if parent_rpcs.respond_to? :list_cmek_configs - @list_cmek_configs = ::Gapic::Config::Method.new list_cmek_configs_config - delete_cmek_config_config = parent_rpcs.delete_cmek_config if parent_rpcs.respond_to? :delete_cmek_config - @delete_cmek_config = ::Gapic::Config::Method.new delete_cmek_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb deleted file mode 100644 index c19fdc397905..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - # Credentials for the CmekConfigService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb deleted file mode 100644 index 7e46827be9d1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CmekConfigService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CmekConfigService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb deleted file mode 100644 index a3f240d94c6e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - # Path helper methods for the CmekConfigService API. - module Paths - ## - # Create a fully-qualified CmekConfig resource string. - # - # @overload cmek_config_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfig` - # - # @param project [String] - # @param location [String] - # - # @overload cmek_config_path(project:, location:, cmek_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` - # - # @param project [String] - # @param location [String] - # @param cmek_config [String] - # - # @return [::String] - def cmek_config_path **args - resources = { - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfig" - end), - "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified CryptoKeyVersions resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified CryptoKeys resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_keys_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb deleted file mode 100644 index d1897c55899f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/cmek_config_service/credentials" -require "google/cloud/discovery_engine/v1/cmek_config_service/paths" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest/operations" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing CMEK related tasks - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/cmek_config_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - module CmekConfigService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb deleted file mode 100644 index f0dff4b94886..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb +++ /dev/null @@ -1,749 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - module Rest - ## - # REST client for the CmekConfigService service. - # - # Service for managing CMEK related tasks - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cmek_config_service_stub - - ## - # Configure the CmekConfigService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CmekConfigService clients - # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CmekConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cmek_config_service_stub.universe_domain - end - - ## - # Create a new CmekConfigService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CmekConfigService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cmek_config_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cmek_config_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cmek_config_service_stub.endpoint - config.universe_domain = @cmek_config_service_stub.universe_domain - config.logger = @cmek_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cmek_config_service_stub.logger - end - - # Service calls - - ## - # Provisions a CMEK key for use in a location of a customer's project. - # This method will also conduct location validation on the provided - # cmekConfig to make sure the key is valid and can be used in the - # selected location. - # - # @overload update_cmek_config(request, options = nil) - # Pass arguments to `update_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_cmek_config(config: nil, set_default: nil) - # Pass arguments to `update_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param config [::Google::Cloud::DiscoveryEngine::V1::CmekConfig, ::Hash] - # Required. The CmekConfig resource. - # @param set_default [::Boolean] - # Set the following CmekConfig as the default to be used for child - # resources if one is not specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new - # - # # Call the update_cmek_config method. - # result = client.update_cmek_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_cmek_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.update_cmek_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}. - # - # @overload get_cmek_config(request, options = nil) - # Pass arguments to `get_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cmek_config(name: nil) - # Pass arguments to `get_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as - # `projects/*/locations/*/cmekConfig` or - # `projects/*/locations/*/cmekConfigs/*`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new - # - # # Call the get_cmek_config method. - # result = client.get_cmek_config request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. - # p result - # - def get_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cmek_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.get_cmek_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s - # with the project. - # - # @overload list_cmek_configs(request, options = nil) - # Pass arguments to `list_cmek_configs` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_cmek_configs(parent: nil) - # Pass arguments to `list_cmek_configs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent location resource name, such as - # `projects/{project}/locations/{location}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this - # location, regardless of whether or not a CmekConfig exists, a - # PERMISSION_DENIED error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new - # - # # Call the list_cmek_configs method. - # result = client.list_cmek_configs request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. - # p result - # - def list_cmek_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_cmek_configs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_cmek_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_cmek_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.list_cmek_configs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # De-provisions a CmekConfig. - # - # @overload delete_cmek_config(request, options = nil) - # Pass arguments to `delete_cmek_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_cmek_config(name: nil) - # Pass arguments to `delete_cmek_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new - # - # # Call the delete_cmek_config method. - # result = client.delete_cmek_config request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cmek_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_cmek_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_cmek_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cmek_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cmek_config_service_stub.delete_cmek_config request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CmekConfigService REST API. - # - # This class represents the configuration for CmekConfigService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_cmek_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_cmek_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_cmek_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CmekConfigService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cmek_config - ## - # RPC-specific configuration for `get_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cmek_config - ## - # RPC-specific configuration for `list_cmek_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cmek_configs - ## - # RPC-specific configuration for `delete_cmek_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cmek_config - - # @private - def initialize parent_rpcs = nil - update_cmek_config_config = parent_rpcs.update_cmek_config if parent_rpcs.respond_to? :update_cmek_config - @update_cmek_config = ::Gapic::Config::Method.new update_cmek_config_config - get_cmek_config_config = parent_rpcs.get_cmek_config if parent_rpcs.respond_to? :get_cmek_config - @get_cmek_config = ::Gapic::Config::Method.new get_cmek_config_config - list_cmek_configs_config = parent_rpcs.list_cmek_configs if parent_rpcs.respond_to? :list_cmek_configs - @list_cmek_configs = ::Gapic::Config::Method.new list_cmek_configs_config - delete_cmek_config_config = parent_rpcs.delete_cmek_config if parent_rpcs.respond_to? :delete_cmek_config - @delete_cmek_config = ::Gapic::Config::Method.new delete_cmek_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb deleted file mode 100644 index ca012489ef25..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CmekConfigService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CmekConfigService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb deleted file mode 100644 index a0f74c0359bd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb +++ /dev/null @@ -1,341 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - module Rest - ## - # REST service stub for the CmekConfigService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the update_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_cmek_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cmek_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_cmek_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # A result object deserialized from the server's reply - def get_cmek_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cmek_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cmek_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_cmek_configs REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse] - # A result object deserialized from the server's reply - def list_cmek_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_cmek_configs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_cmek_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_cmek_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cmek_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_cmek_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_cmek_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{config.name}", - body: "config", - matches: [ - ["config.name", %r{^projects/[^/]+/locations/[^/]+/cmekConfig/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{config.name}", - body: "config", - matches: [ - ["config.name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cmek_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfig/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_cmek_configs REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_cmek_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/cmekConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cmek_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_cmek_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/cmekConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb deleted file mode 100644 index 46fd292280fb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/completion_service/credentials" -require "google/cloud/discovery_engine/v1/completion_service/paths" -require "google/cloud/discovery_engine/v1/completion_service/operations" -require "google/cloud/discovery_engine/v1/completion_service/client" -require "google/cloud/discovery_engine/v1/completion_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for Auto-Completion. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/completion_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/completion_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - module CompletionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "completion_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/completion_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb deleted file mode 100644 index 913bf9bfb8f0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +++ /dev/null @@ -1,1000 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/completion_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - ## - # Client for the CompletionService service. - # - # Service for Auto-Completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_service_stub - - ## - # Configure the CompletionService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompletionService clients - # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @completion_service_stub.universe_domain - end - - ## - # Create a new CompletionService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompletionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/completion_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @completion_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @completion_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @completion_service_stub.endpoint - config.universe_domain = @completion_service_stub.universe_domain - config.logger = @completion_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_service_stub.logger - end - - # Service calls - - ## - # Completes the specified user input with keyword suggestions. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload complete_query(data_store: nil, query: nil, query_model: nil, user_pseudo_id: nil, include_tail_suggestions: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::String] - # 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`. - # @param query [::String] - # Required. The typeahead input used to fetch suggestions. Maximum length is - # 128 characters. - # @param query_model [::String] - # Specifies the autocomplete data model. This overrides any model specified - # in the Configuration > Autocomplete section of the Cloud console. Currently - # supported values: - # - # * `document` - Using suggestions generated from user-imported documents. - # * `search-history` - Using suggestions generated from the past history of - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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. - # @param user_pseudo_id [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. - # @param include_tail_suggestions [::Boolean] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.complete_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.data_store - header_params["data_store"] = request.data_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.complete_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :complete_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports all - # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} - # for a DataStore. - # - # @overload import_suggestion_deny_list_entries(request, options = nil) - # Pass arguments to `import_suggestion_deny_list_entries` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_suggestion_deny_list_entries(inline_source: nil, gcs_source: nil, parent: nil) - # Pass arguments to `import_suggestion_deny_list_entries` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash] - # The Inline source for the input content for suggestion deny list entries. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Only 1 file can be specified that contains all entries to import. - # Supported values `gcs_source.schema` for autocomplete suggestion deny - # list entry imports: - # - # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] - # per line. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new - # - # # Call the import_suggestion_deny_list_entries method. - # result = client.import_suggestion_deny_list_entries request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_suggestion_deny_list_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_suggestion_deny_list_entries.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_suggestion_deny_list_entries.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_suggestion_deny_list_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :import_suggestion_deny_list_entries, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all - # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} - # for a DataStore. - # - # @overload purge_suggestion_deny_list_entries(request, options = nil) - # Pass arguments to `purge_suggestion_deny_list_entries` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_suggestion_deny_list_entries(parent: nil) - # Pass arguments to `purge_suggestion_deny_list_entries` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new - # - # # Call the purge_suggestion_deny_list_entries method. - # result = client.purge_suggestion_deny_list_entries request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_suggestion_deny_list_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.purge_suggestion_deny_list_entries.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.purge_suggestion_deny_list_entries.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_suggestion_deny_list_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :purge_suggestion_deny_list_entries, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # for a DataStore. - # - # @overload import_completion_suggestions(request, options = nil) - # Pass arguments to `import_completion_suggestions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) - # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash] - # The Inline source for suggestion entries. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent data store resource name for which to import customer - # autocomplete suggestions. - # - # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new - # - # # Call the import_completion_suggestions method. - # result = client.import_completion_suggestions request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_completion_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_completion_suggestions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_completion_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :import_completion_suggestions, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # for a DataStore. - # - # @overload purge_completion_suggestions(request, options = nil) - # Pass arguments to `purge_completion_suggestions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_completion_suggestions(parent: nil) - # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name for which to purge completion - # suggestions. Follows pattern - # projects/*/locations/*/collections/*/dataStores/*. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new - # - # # Call the purge_completion_suggestions method. - # result = client.purge_completion_suggestions request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_completion_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.call_rpc :purge_completion_suggestions, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompletionService API. - # - # This class represents the configuration for CompletionService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the CompletionService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - ## - # RPC-specific configuration for `import_suggestion_deny_list_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :import_suggestion_deny_list_entries - ## - # RPC-specific configuration for `purge_suggestion_deny_list_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_suggestion_deny_list_entries - ## - # RPC-specific configuration for `import_completion_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :import_completion_suggestions - ## - # RPC-specific configuration for `purge_completion_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_completion_suggestions - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries - @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config - purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries - @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config - import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions - @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config - purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions - @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb deleted file mode 100644 index 527b10cfb665..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - # Credentials for the CompletionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb deleted file mode 100644 index 3e1f3291610e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CompletionService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb deleted file mode 100644 index 4f9715b1085b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/paths.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - # Path helper methods for the CompletionService API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb deleted file mode 100644 index f283ce19f263..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/completion_service/credentials" -require "google/cloud/discovery_engine/v1/completion_service/paths" -require "google/cloud/discovery_engine/v1/completion_service/rest/operations" -require "google/cloud/discovery_engine/v1/completion_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for Auto-Completion. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/completion_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - module CompletionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/completion_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb deleted file mode 100644 index e590c85b788b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +++ /dev/null @@ -1,922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/completion_service_pb" -require "google/cloud/discovery_engine/v1/completion_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - module Rest - ## - # REST client for the CompletionService service. - # - # Service for Auto-Completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_service_stub - - ## - # Configure the CompletionService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompletionService clients - # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @completion_service_stub.universe_domain - end - - ## - # Create a new CompletionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompletionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @completion_service_stub = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @completion_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @completion_service_stub.endpoint - config.universe_domain = @completion_service_stub.universe_domain - config.logger = @completion_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_service_stub.logger - end - - # Service calls - - ## - # Completes the specified user input with keyword suggestions. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload complete_query(data_store: nil, query: nil, query_model: nil, user_pseudo_id: nil, include_tail_suggestions: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::String] - # 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`. - # @param query [::String] - # Required. The typeahead input used to fetch suggestions. Maximum length is - # 128 characters. - # @param query_model [::String] - # Specifies the autocomplete data model. This overrides any model specified - # in the Configuration > Autocomplete section of the Cloud console. Currently - # supported values: - # - # * `document` - Using suggestions generated from user-imported documents. - # * `search-history` - Using suggestions generated from the past history of - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search 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. - # @param user_pseudo_id [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. - # @param include_tail_suggestions [::Boolean] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.complete_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.complete_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.complete_query request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports all - # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} - # for a DataStore. - # - # @overload import_suggestion_deny_list_entries(request, options = nil) - # Pass arguments to `import_suggestion_deny_list_entries` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_suggestion_deny_list_entries(inline_source: nil, gcs_source: nil, parent: nil) - # Pass arguments to `import_suggestion_deny_list_entries` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource, ::Hash] - # The Inline source for the input content for suggestion deny list entries. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Only 1 file can be specified that contains all entries to import. - # Supported values `gcs_source.schema` for autocomplete suggestion deny - # list entry imports: - # - # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] - # per line. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new - # - # # Call the import_suggestion_deny_list_entries method. - # result = client.import_suggestion_deny_list_entries request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_suggestion_deny_list_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_suggestion_deny_list_entries.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_suggestion_deny_list_entries.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_suggestion_deny_list_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.import_suggestion_deny_list_entries request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all - # {::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry SuggestionDenyListEntry} - # for a DataStore. - # - # @overload purge_suggestion_deny_list_entries(request, options = nil) - # Pass arguments to `purge_suggestion_deny_list_entries` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_suggestion_deny_list_entries(parent: nil) - # Pass arguments to `purge_suggestion_deny_list_entries` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new - # - # # Call the purge_suggestion_deny_list_entries method. - # result = client.purge_suggestion_deny_list_entries request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_suggestion_deny_list_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.purge_suggestion_deny_list_entries.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_suggestion_deny_list_entries.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_suggestion_deny_list_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.purge_suggestion_deny_list_entries request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # for a DataStore. - # - # @overload import_completion_suggestions(request, options = nil) - # Pass arguments to `import_completion_suggestions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_completion_suggestions(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) - # Pass arguments to `import_completion_suggestions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource, ::Hash] - # The Inline source for suggestion entries. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent data store resource name for which to import customer - # autocomplete suggestions. - # - # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new - # - # # Call the import_completion_suggestions method. - # result = client.import_completion_suggestions request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_completion_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_completion_suggestions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_completion_suggestions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_completion_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.import_completion_suggestions request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # for a DataStore. - # - # @overload purge_completion_suggestions(request, options = nil) - # Pass arguments to `purge_completion_suggestions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_completion_suggestions(parent: nil) - # Pass arguments to `purge_completion_suggestions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name for which to purge completion - # suggestions. Follows pattern - # projects/*/locations/*/collections/*/dataStores/*. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new - # - # # Call the purge_completion_suggestions method. - # result = client.purge_completion_suggestions request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_completion_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.purge_completion_suggestions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_completion_suggestions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_completion_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_service_stub.purge_completion_suggestions request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompletionService REST API. - # - # This class represents the configuration for CompletionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the CompletionService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - ## - # RPC-specific configuration for `import_suggestion_deny_list_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :import_suggestion_deny_list_entries - ## - # RPC-specific configuration for `purge_suggestion_deny_list_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_suggestion_deny_list_entries - ## - # RPC-specific configuration for `import_completion_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :import_completion_suggestions - ## - # RPC-specific configuration for `purge_completion_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_completion_suggestions - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - import_suggestion_deny_list_entries_config = parent_rpcs.import_suggestion_deny_list_entries if parent_rpcs.respond_to? :import_suggestion_deny_list_entries - @import_suggestion_deny_list_entries = ::Gapic::Config::Method.new import_suggestion_deny_list_entries_config - purge_suggestion_deny_list_entries_config = parent_rpcs.purge_suggestion_deny_list_entries if parent_rpcs.respond_to? :purge_suggestion_deny_list_entries - @purge_suggestion_deny_list_entries = ::Gapic::Config::Method.new purge_suggestion_deny_list_entries_config - import_completion_suggestions_config = parent_rpcs.import_completion_suggestions if parent_rpcs.respond_to? :import_completion_suggestions - @import_completion_suggestions = ::Gapic::Config::Method.new import_completion_suggestions_config - purge_completion_suggestions_config = parent_rpcs.purge_completion_suggestions if parent_rpcs.respond_to? :purge_completion_suggestions - @purge_completion_suggestions = ::Gapic::Config::Method.new purge_completion_suggestions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb deleted file mode 100644 index 84b0beca2122..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the CompletionService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the CompletionService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb deleted file mode 100644 index 21c87e44ff21..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +++ /dev/null @@ -1,429 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/completion_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - module Rest - ## - # REST service stub for the CompletionService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the complete_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] - # A result object deserialized from the server's reply - def complete_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "complete_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_suggestion_deny_list_entries REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_suggestion_deny_list_entries request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_suggestion_deny_list_entries_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_suggestion_deny_list_entries", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_suggestion_deny_list_entries REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def purge_suggestion_deny_list_entries request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_suggestion_deny_list_entries_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "purge_suggestion_deny_list_entries", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_completion_suggestions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_completion_suggestions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_completion_suggestions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_completion_suggestions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_completion_suggestions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def purge_completion_suggestions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_completion_suggestions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "purge_completion_suggestions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the complete_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_complete_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{data_store}:completeQuery", - matches: [ - ["data_store", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{data_store}:completeQuery", - matches: [ - ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_suggestion_deny_list_entries REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_suggestion_deny_list_entries_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/suggestionDenyListEntries:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/suggestionDenyListEntries:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_suggestion_deny_list_entries REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_suggestion_deny_list_entries_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/suggestionDenyListEntries:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/suggestionDenyListEntries:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_completion_suggestions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_completion_suggestions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/completionSuggestions:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/completionSuggestions:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_completion_suggestions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_completion_suggestions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/completionSuggestions:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/completionSuggestions:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb deleted file mode 100644 index 9613d6b89910..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/control_service/credentials" -require "google/cloud/discovery_engine/v1/control_service/paths" -require "google/cloud/discovery_engine/v1/control_service/client" -require "google/cloud/discovery_engine/v1/control_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for performing CRUD operations on Controls. - # Controls allow for custom logic to be implemented in the serving path. - # Controls need to be attached to a Serving Config to be considered during a - # request. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/control_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/control_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - module ControlService - end - end - end - end -end - -helper_path = ::File.join __dir__, "control_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/control_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb deleted file mode 100644 index c1e892c4e02a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/client.rb +++ /dev/null @@ -1,922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/control_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - ## - # Client for the ControlService service. - # - # Service for performing CRUD operations on Controls. - # Controls allow for custom logic to be implemented in the serving path. - # Controls need to be attached to a Serving Config to be considered during a - # request. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :control_service_stub - - ## - # Configure the ControlService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ControlService clients - # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ControlService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @control_service_stub.universe_domain - end - - ## - # Create a new ControlService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ControlService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/control_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @control_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @control_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @control_service_stub.endpoint - config.universe_domain = @control_service_stub.universe_domain - config.logger = @control_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @control_service_stub.logger - end - - # Service calls - - ## - # Creates a Control. - # - # By default 1000 controls are allowed for a data store. - # A request can be submitted to adjust this limit. - # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_control(request, options = nil) - # Pass arguments to `create_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_control(parent: nil, control: nil, control_id: nil) - # Pass arguments to `create_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] - # Required. The Control to create. - # @param control_id [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value must be within 1-63 characters. - # Valid characters are /[a-z][0-9]-_/. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new - # - # # Call the create_control method. - # result = client.create_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def create_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :create_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Control. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_control(request, options = nil) - # Pass arguments to `delete_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_control(name: nil) - # Pass arguments to `delete_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new - # - # # Call the delete_control method. - # result = client.delete_control request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :delete_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Control. - # - # {::Google::Cloud::DiscoveryEngine::V1::Control Control} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_control(request, options = nil) - # Pass arguments to `update_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_control(control: nil, update_mask: nil) - # Pass arguments to `update_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] - # Required. The Control to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} - # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new - # - # # Call the update_control method. - # result = client.update_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def update_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.control&.name - header_params["control.name"] = request.control.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :update_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Control. - # - # @overload get_control(request, options = nil) - # Pass arguments to `get_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_control(name: nil) - # Pass arguments to `get_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new - # - # # Call the get_control method. - # result = client.get_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def get_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_control.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :get_control, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Controls by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_controls(request, options = nil) - # Pass arguments to `list_controls` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_controls` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is - # unset. Currently this field is unsupported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new - # - # # Call the list_controls method. - # result = client.list_controls request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. - # p item - # end - # - def list_controls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_controls.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_controls.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_controls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.call_rpc :list_controls, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @control_service_stub, :list_controls, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ControlService API. - # - # This class represents the configuration for ControlService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_control to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ControlService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_control` - # @return [::Gapic::Config::Method] - # - attr_reader :create_control - ## - # RPC-specific configuration for `delete_control` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_control - ## - # RPC-specific configuration for `update_control` - # @return [::Gapic::Config::Method] - # - attr_reader :update_control - ## - # RPC-specific configuration for `get_control` - # @return [::Gapic::Config::Method] - # - attr_reader :get_control - ## - # RPC-specific configuration for `list_controls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_controls - - # @private - def initialize parent_rpcs = nil - create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control - @create_control = ::Gapic::Config::Method.new create_control_config - delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control - @delete_control = ::Gapic::Config::Method.new delete_control_config - update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control - @update_control = ::Gapic::Config::Method.new update_control_config - get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control - @get_control = ::Gapic::Config::Method.new get_control_config - list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls - @list_controls = ::Gapic::Config::Method.new list_controls_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb deleted file mode 100644 index d50a1fa0c1d0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - # Credentials for the ControlService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb deleted file mode 100644 index c812b764bd0a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +++ /dev/null @@ -1,220 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - # Path helper methods for the ControlService API. - module Paths - ## - # Create a fully-qualified Control resource string. - # - # @overload control_path(project:, location:, data_store:, control:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param control [String] - # - # @overload control_path(project:, location:, collection:, data_store:, control:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param control [String] - # - # @overload control_path(project:, location:, collection:, engine:, control:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param control [String] - # - # @return [::String] - def control_path **args - resources = { - "control:data_store:location:project" => (proc do |project:, location:, data_store:, control:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/controls/#{control}" - end), - "collection:control:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, control:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/controls/#{control}" - end), - "collection:control:engine:location:project" => (proc do |project:, location:, collection:, engine:, control:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/controls/#{control}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Engine resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # - # @return [::String] - def engine_path project:, location:, collection:, engine: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb deleted file mode 100644 index ea18df587272..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/control_service/credentials" -require "google/cloud/discovery_engine/v1/control_service/paths" -require "google/cloud/discovery_engine/v1/control_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for performing CRUD operations on Controls. - # Controls allow for custom logic to be implemented in the serving path. - # Controls need to be attached to a Serving Config to be considered during a - # request. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/control_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - module ControlService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/control_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb deleted file mode 100644 index 072b70f4c605..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +++ /dev/null @@ -1,844 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/control_service_pb" -require "google/cloud/discovery_engine/v1/control_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - module Rest - ## - # REST client for the ControlService service. - # - # Service for performing CRUD operations on Controls. - # Controls allow for custom logic to be implemented in the serving path. - # Controls need to be attached to a Serving Config to be considered during a - # request. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :control_service_stub - - ## - # Configure the ControlService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ControlService clients - # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ControlService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @control_service_stub.universe_domain - end - - ## - # Create a new ControlService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ControlService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @control_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @control_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @control_service_stub.endpoint - config.universe_domain = @control_service_stub.universe_domain - config.logger = @control_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @control_service_stub.logger - end - - # Service calls - - ## - # Creates a Control. - # - # By default 1000 controls are allowed for a data store. - # A request can be submitted to adjust this limit. - # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_control(request, options = nil) - # Pass arguments to `create_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_control(parent: nil, control: nil, control_id: nil) - # Pass arguments to `create_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] - # Required. The Control to create. - # @param control_id [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value must be within 1-63 characters. - # Valid characters are /[a-z][0-9]-_/. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new - # - # # Call the create_control method. - # result = client.create_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def create_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.create_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Control. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_control(request, options = nil) - # Pass arguments to `delete_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_control(name: nil) - # Pass arguments to `delete_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new - # - # # Call the delete_control method. - # result = client.delete_control request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.delete_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Control. - # - # {::Google::Cloud::DiscoveryEngine::V1::Control Control} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Control Control} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_control(request, options = nil) - # Pass arguments to `update_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_control(control: nil, update_mask: nil) - # Pass arguments to `update_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param control [::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash] - # Required. The Control to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} - # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new - # - # # Call the update_control method. - # result = client.update_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def update_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.update_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Control. - # - # @overload get_control(request, options = nil) - # Pass arguments to `get_control` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetControlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_control(name: nil) - # Pass arguments to `get_control` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new - # - # # Call the get_control method. - # result = client.get_control request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - # p result - # - def get_control request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_control.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_control.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_control.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.get_control request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Controls by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_controls(request, options = nil) - # Pass arguments to `list_controls` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_controls` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @param page_size [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is - # unset. Currently this field is unsupported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new - # - # # Call the list_controls method. - # result = client.list_controls request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. - # p item - # end - # - def list_controls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_controls.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_controls.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_controls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @control_service_stub.list_controls request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @control_service_stub, :list_controls, "controls", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ControlService REST API. - # - # This class represents the configuration for ControlService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_control to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_control.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ControlService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_control` - # @return [::Gapic::Config::Method] - # - attr_reader :create_control - ## - # RPC-specific configuration for `delete_control` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_control - ## - # RPC-specific configuration for `update_control` - # @return [::Gapic::Config::Method] - # - attr_reader :update_control - ## - # RPC-specific configuration for `get_control` - # @return [::Gapic::Config::Method] - # - attr_reader :get_control - ## - # RPC-specific configuration for `list_controls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_controls - - # @private - def initialize parent_rpcs = nil - create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control - @create_control = ::Gapic::Config::Method.new create_control_config - delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control - @delete_control = ::Gapic::Config::Method.new delete_control_config - update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control - @update_control = ::Gapic::Config::Method.new update_control_config - get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control - @get_control = ::Gapic::Config::Method.new get_control_config - list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls - @list_controls = ::Gapic::Config::Method.new list_controls_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb deleted file mode 100644 index fb345d714714..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +++ /dev/null @@ -1,462 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/control_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - module Rest - ## - # REST service stub for the ControlService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # A result object deserialized from the server's reply - def create_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_control_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_control_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # A result object deserialized from the server's reply - def update_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_control_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Control] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # A result object deserialized from the server's reply - def get_control request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_control_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_control", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Control.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_controls REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse] - # A result object deserialized from the server's reply - def list_controls request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_controls_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_controls", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/controls", - body: "control", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/controls", - body: "control", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/controls", - body: "control", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{control.name}", - body: "control", - matches: [ - ["control.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{control.name}", - body: "control", - matches: [ - ["control.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{control.name}", - body: "control", - matches: [ - ["control.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_control REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetControlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_control_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/controls/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/controls/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_controls REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_controls_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/controls", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/controls", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/controls", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb deleted file mode 100644 index aaaf9bd740ea..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/conversational_search_service/credentials" -require "google/cloud/discovery_engine/v1/conversational_search_service/paths" -require "google/cloud/discovery_engine/v1/conversational_search_service/client" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for conversational search. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/conversational_search_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/conversational_search_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - module ConversationalSearchService - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversational_search_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/conversational_search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb deleted file mode 100644 index ea00baceaec3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +++ /dev/null @@ -1,2026 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/conversational_search_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - ## - # Client for the ConversationalSearchService service. - # - # Service for conversational search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversational_search_service_stub - - ## - # Configure the ConversationalSearchService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationalSearchService clients - # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationalSearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @conversational_search_service_stub.universe_domain - end - - ## - # Create a new ConversationalSearchService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationalSearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/conversational_search_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @conversational_search_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @conversational_search_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @conversational_search_service_stub.endpoint - config.universe_domain = @conversational_search_service_stub.universe_domain - config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @conversational_search_service_stub.logger - end - - # Service calls - - ## - # Converses a conversation. - # - # @overload converse_conversation(request, options = nil) - # Pass arguments to `converse_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) - # Pass arguments to `converse_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. - # Use - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` - # to activate auto session mode, which automatically creates a new - # conversation inside a ConverseConversation session. - # @param query [::Google::Cloud::DiscoveryEngine::V1::TextInput, ::Hash] - # Required. Current user input. - # @param serving_config [::String] - # The resource name of the Serving Config to use. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` - # If this is not set, the default serving config will be used. - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # 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. - # @param safe_search [::Boolean] - # Whether to turn on safe search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param summary_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec, ::Hash] - # A specification for configuring the summary returned in the response. - # @param filter [::String] - # 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. This will be used to filter search results - # which may affect the summary response. - # - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents in search results which may - # affect the converse response. For more information on boosting, see - # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new - # - # # Call the converse_conversation method. - # result = client.converse_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. - # p result - # - def converse_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.converse_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.converse_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.converse_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :converse_conversation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Conversation. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to - # create already exists, an ALREADY_EXISTS error is returned. - # - # @overload create_conversation(request, options = nil) - # Pass arguments to `create_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_conversation(parent: nil, conversation: nil) - # Pass arguments to `create_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # Required. The conversation to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new - # - # # Call the create_conversation method. - # result = client.create_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def create_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :create_conversation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Conversation. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to - # delete does not exist, a NOT_FOUND error is returned. - # - # @overload delete_conversation(request, options = nil) - # Pass arguments to `delete_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_conversation(name: nil) - # Pass arguments to `delete_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new - # - # # Call the delete_conversation method. - # result = client.delete_conversation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :delete_conversation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Conversation. - # - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} action type - # cannot be changed. If the - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update does - # not exist, a NOT_FOUND error is returned. - # - # @overload update_conversation(request, options = nil) - # Pass arguments to `update_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_conversation(conversation: nil, update_mask: nil) - # Pass arguments to `update_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # Required. The Conversation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new - # - # # Call the update_conversation method. - # result = client.update_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def update_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.conversation&.name - header_params["conversation.name"] = request.conversation.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :update_conversation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Conversation. - # - # @overload get_conversation(request, options = nil) - # Pass arguments to `get_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_conversation(name: nil) - # Pass arguments to `get_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new - # - # # Call the get_conversation method. - # result = client.get_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def get_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :get_conversation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Conversations by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_conversations(request, options = nil) - # Pass arguments to `list_conversations` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_conversations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListConversations` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A filter to apply on the list results. The supported features are: - # user_pseudo_id, state. - # - # Example: - # "user_pseudo_id = some_id" - # @param order_by [::String] - # 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" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new - # - # # Call the list_conversations method. - # result = client.list_conversations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. - # p item - # end - # - def list_conversations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_conversations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_conversations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_conversations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :list_conversations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Answer query method. - # - # @overload answer_query(request, options = nil) - # Pass arguments to `answer_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) - # Pass arguments to `answer_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. - # This field is used to identify the serving configuration name, set - # of models used to make the search. - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Required. Current user query. - # @param session [::String] - # The session resource name. Not required. - # - # When session field is not set, the API is in sessionless mode. - # - # We support auto session mode: users can use the wildcard symbol `-` as - # session ID. A new ID will be automatically generated and assigned. - # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] - # Model specification. - # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] - # Related questions specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] - # Optional. Grounding specification. - # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] - # Answer generation specification. - # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] - # Search specification. - # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] - # Query understanding specification. - # @param asynchronous_mode [::Boolean] - # Deprecated: This field is deprecated. Streaming Answer API will be - # supported. - # - # Asynchronous mode control. - # - # If enabled, the response will be returned with answer/session resource - # name without final answer. The API users need to do the polling to get - # the latest status of answer/session by calling - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} - # or - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} - # method. - # @param user_pseudo_id [::String] - # 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`. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] - # Optional. End user specification. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - # - # # Call the answer_query method. - # result = client.answer_query request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. - # p result - # - def answer_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.answer_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.answer_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.answer_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :answer_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Answer query method (streaming). - # - # It takes one - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} - # and returns multiple - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse AnswerQueryResponse} - # messages in a stream. - # - # @overload stream_answer_query(request, options = nil) - # Pass arguments to `stream_answer_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) - # Pass arguments to `stream_answer_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. - # This field is used to identify the serving configuration name, set - # of models used to make the search. - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Required. Current user query. - # @param session [::String] - # The session resource name. Not required. - # - # When session field is not set, the API is in sessionless mode. - # - # We support auto session mode: users can use the wildcard symbol `-` as - # session ID. A new ID will be automatically generated and assigned. - # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] - # Model specification. - # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] - # Related questions specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] - # Optional. Grounding specification. - # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] - # Answer generation specification. - # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] - # Search specification. - # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] - # Query understanding specification. - # @param asynchronous_mode [::Boolean] - # Deprecated: This field is deprecated. Streaming Answer API will be - # supported. - # - # Asynchronous mode control. - # - # If enabled, the response will be returned with answer/session resource - # name without final answer. The API users need to do the polling to get - # the latest status of answer/session by calling - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} - # or - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} - # method. - # @param user_pseudo_id [::String] - # 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`. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] - # Optional. End user specification. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - # - # # Call the stream_answer_query method to start streaming. - # output = client.stream_answer_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def stream_answer_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.stream_answer_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.stream_answer_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stream_answer_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :stream_answer_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Answer. - # - # @overload get_answer(request, options = nil) - # Pass arguments to `get_answer` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_answer(name: nil) - # Pass arguments to `get_answer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Answer to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Answer] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new - # - # # Call the get_answer method. - # result = client.get_answer request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. - # p result - # - def get_answer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_answer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_answer.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_answer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :get_answer, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session(parent: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The session to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :create_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :delete_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Session. - # - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_session(request, options = nil) - # Pass arguments to `update_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_session(session: nil, update_mask: nil) - # Pass arguments to `update_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The Session to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - # - # # Call the update_session method. - # result = client.update_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def update_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session&.name - header_params["session.name"] = request.session.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :update_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session(name: nil, include_answer_details: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @param include_answer_details [::Boolean] - # Optional. If set to true, the full session including all answer details - # will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :get_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Sessions by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSessions` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A comma-separated list of fields to filter by, in EBNF grammar. - # The supported fields are: - # * `user_pseudo_id` - # * `state` - # * `display_name` - # * `starred` - # * `is_pinned` - # * `labels` - # * `create_time` - # * `update_time` - # - # Examples: - # "user_pseudo_id = some_id" - # "display_name = \"some_name\"" - # "starred = true" - # "is_pinned=true AND (NOT labels:hidden)" - # "create_time > \"1970-01-01T12:00:00Z\"" - # @param order_by [::String] - # 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` - # * `session_name` - # * `is_pinned` - # - # Example: - # - # * "update_time desc" - # * "create_time" - # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then - # by update_time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.call_rpc :list_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ConversationalSearchService API. - # - # This class represents the configuration for ConversationalSearchService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # converse_conversation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.converse_conversation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.converse_conversation.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ConversationalSearchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `converse_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :converse_conversation - ## - # RPC-specific configuration for `create_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation - ## - # RPC-specific configuration for `delete_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation - ## - # RPC-specific configuration for `update_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_conversation - ## - # RPC-specific configuration for `get_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation - ## - # RPC-specific configuration for `list_conversations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversations - ## - # RPC-specific configuration for `answer_query` - # @return [::Gapic::Config::Method] - # - attr_reader :answer_query - ## - # RPC-specific configuration for `stream_answer_query` - # @return [::Gapic::Config::Method] - # - attr_reader :stream_answer_query - ## - # RPC-specific configuration for `get_answer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_answer - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `update_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - - # @private - def initialize parent_rpcs = nil - converse_conversation_config = parent_rpcs.converse_conversation if parent_rpcs.respond_to? :converse_conversation - @converse_conversation = ::Gapic::Config::Method.new converse_conversation_config - create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation - @create_conversation = ::Gapic::Config::Method.new create_conversation_config - delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation - @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config - update_conversation_config = parent_rpcs.update_conversation if parent_rpcs.respond_to? :update_conversation - @update_conversation = ::Gapic::Config::Method.new update_conversation_config - get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation - @get_conversation = ::Gapic::Config::Method.new get_conversation_config - list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations - @list_conversations = ::Gapic::Config::Method.new list_conversations_config - answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query - @answer_query = ::Gapic::Config::Method.new answer_query_config - stream_answer_query_config = parent_rpcs.stream_answer_query if parent_rpcs.respond_to? :stream_answer_query - @stream_answer_query = ::Gapic::Config::Method.new stream_answer_query_config - get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer - @get_answer = ::Gapic::Config::Method.new get_answer_config - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session - @update_session = ::Gapic::Config::Method.new update_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb deleted file mode 100644 index 9221f872e79f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - # Credentials for the ConversationalSearchService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb deleted file mode 100644 index 59378d548c66..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +++ /dev/null @@ -1,491 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - # Path helper methods for the ConversationalSearchService API. - module Paths - ## - # Create a fully-qualified Answer resource string. - # - # @overload answer_path(project:, location:, data_store:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # @param answer [String] - # - # @overload answer_path(project:, location:, collection:, data_store:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # @param answer [String] - # - # @overload answer_path(project:, location:, collection:, engine:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # @param answer [String] - # - # @return [::String] - def answer_path **args - resources = { - "answer:data_store:location:project:session" => (proc do |project:, location:, data_store:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" - end), - "answer:collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" - end), - "answer:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/answers/#{answer}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified AssistAnswer resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # @param assist_answer [String] - # - # @return [::String] - def assist_answer_path project:, location:, collection:, engine:, session:, assist_answer: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/assistAnswers/#{assist_answer}" - end - - ## - # Create a fully-qualified Chunk resource string. - # - # @overload chunk_path(project:, location:, data_store:, branch:, document:, chunk:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # @param chunk [String] - # - # @overload chunk_path(project:, location:, collection:, data_store:, branch:, document:, chunk:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # @param chunk [String] - # - # @return [::String] - def chunk_path **args - resources = { - "branch:chunk:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:, chunk:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" - end), - "branch:chunk:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:, chunk:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Conversation resource string. - # - # @overload conversation_path(project:, location:, data_store:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param conversation [String] - # - # @overload conversation_path(project:, location:, collection:, data_store:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param conversation [String] - # - # @overload conversation_path(project:, location:, collection:, engine:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param conversation [String] - # - # @return [::String] - def conversation_path **args - resources = { - "conversation:data_store:location:project" => (proc do |project:, location:, data_store:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/conversations/#{conversation}" - end), - "collection:conversation:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/conversations/#{conversation}" - end), - "collection:conversation:engine:location:project" => (proc do |project:, location:, collection:, engine:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/conversations/#{conversation}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified ServingConfig resource string. - # - # @overload serving_config_path(project:, location:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path **args - resources = { - "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, engine:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb deleted file mode 100644 index a93bd621ec05..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/conversational_search_service/credentials" -require "google/cloud/discovery_engine/v1/conversational_search_service/paths" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for conversational search. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/conversational_search_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - module ConversationalSearchService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb deleted file mode 100644 index 7c7a56c7e99e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +++ /dev/null @@ -1,1887 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/conversational_search_service_pb" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - module Rest - ## - # REST client for the ConversationalSearchService service. - # - # Service for conversational search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversational_search_service_stub - - ## - # Configure the ConversationalSearchService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationalSearchService clients - # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationalSearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @conversational_search_service_stub.universe_domain - end - - ## - # Create a new ConversationalSearchService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationalSearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @conversational_search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversational_search_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @conversational_search_service_stub.endpoint - config.universe_domain = @conversational_search_service_stub.universe_domain - config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @conversational_search_service_stub.logger - end - - # Service calls - - ## - # Converses a conversation. - # - # @overload converse_conversation(request, options = nil) - # Pass arguments to `converse_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload converse_conversation(name: nil, query: nil, serving_config: nil, conversation: nil, safe_search: nil, user_labels: nil, summary_spec: nil, filter: nil, boost_spec: nil) - # Pass arguments to `converse_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. - # Use - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` - # to activate auto session mode, which automatically creates a new - # conversation inside a ConverseConversation session. - # @param query [::Google::Cloud::DiscoveryEngine::V1::TextInput, ::Hash] - # Required. Current user input. - # @param serving_config [::String] - # The resource name of the Serving Config to use. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` - # If this is not set, the default serving config will be used. - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # 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. - # @param safe_search [::Boolean] - # Whether to turn on safe search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param summary_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec, ::Hash] - # A specification for configuring the summary returned in the response. - # @param filter [::String] - # 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. This will be used to filter search results - # which may affect the summary response. - # - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents in search results which may - # affect the converse response. For more information on boosting, see - # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new - # - # # Call the converse_conversation method. - # result = client.converse_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. - # p result - # - def converse_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.converse_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.converse_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.converse_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.converse_conversation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Conversation. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to - # create already exists, an ALREADY_EXISTS error is returned. - # - # @overload create_conversation(request, options = nil) - # Pass arguments to `create_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_conversation(parent: nil, conversation: nil) - # Pass arguments to `create_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # Required. The conversation to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new - # - # # Call the create_conversation method. - # result = client.create_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def create_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.create_conversation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Conversation. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to - # delete does not exist, a NOT_FOUND error is returned. - # - # @overload delete_conversation(request, options = nil) - # Pass arguments to `delete_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_conversation(name: nil) - # Pass arguments to `delete_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new - # - # # Call the delete_conversation method. - # result = client.delete_conversation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.delete_conversation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Conversation. - # - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} action type - # cannot be changed. If the - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update does - # not exist, a NOT_FOUND error is returned. - # - # @overload update_conversation(request, options = nil) - # Pass arguments to `update_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_conversation(conversation: nil, update_mask: nil) - # Pass arguments to `update_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param conversation [::Google::Cloud::DiscoveryEngine::V1::Conversation, ::Hash] - # Required. The Conversation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new - # - # # Call the update_conversation method. - # result = client.update_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def update_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.update_conversation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Conversation. - # - # @overload get_conversation(request, options = nil) - # Pass arguments to `get_conversation` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_conversation(name: nil) - # Pass arguments to `get_conversation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new - # - # # Call the get_conversation method. - # result = client.get_conversation request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - # p result - # - def get_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_conversation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.get_conversation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Conversations by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_conversations(request, options = nil) - # Pass arguments to `list_conversations` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_conversations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListConversations` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A filter to apply on the list results. The supported features are: - # user_pseudo_id, state. - # - # Example: - # "user_pseudo_id = some_id" - # @param order_by [::String] - # 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" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new - # - # # Call the list_conversations method. - # result = client.list_conversations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. - # p item - # end - # - def list_conversations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_conversations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_conversations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_conversations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.list_conversations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, "conversations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Answer query method. - # - # @overload answer_query(request, options = nil) - # Pass arguments to `answer_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) - # Pass arguments to `answer_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. - # This field is used to identify the serving configuration name, set - # of models used to make the search. - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Required. Current user query. - # @param session [::String] - # The session resource name. Not required. - # - # When session field is not set, the API is in sessionless mode. - # - # We support auto session mode: users can use the wildcard symbol `-` as - # session ID. A new ID will be automatically generated and assigned. - # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] - # Model specification. - # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] - # Related questions specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] - # Optional. Grounding specification. - # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] - # Answer generation specification. - # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] - # Search specification. - # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] - # Query understanding specification. - # @param asynchronous_mode [::Boolean] - # Deprecated: This field is deprecated. Streaming Answer API will be - # supported. - # - # Asynchronous mode control. - # - # If enabled, the response will be returned with answer/session resource - # name without final answer. The API users need to do the polling to get - # the latest status of answer/session by calling - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_answer ConversationalSearchService.GetAnswer} - # or - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_session ConversationalSearchService.GetSession} - # method. - # @param user_pseudo_id [::String] - # 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`. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] - # Optional. End user specification. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - # - # # Call the answer_query method. - # result = client.answer_query request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. - # p result - # - def answer_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.answer_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.answer_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.answer_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.answer_query request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Answer query method (streaming). - # - # It takes one - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} - # and returns multiple - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse AnswerQueryResponse} - # messages in a stream. - # - # @overload stream_answer_query(request, options = nil) - # Pass arguments to `stream_answer_query` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stream_answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil, end_user_spec: nil) - # Pass arguments to `stream_answer_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. - # This field is used to identify the serving configuration name, set - # of models used to make the search. - # @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash] - # Required. Current user query. - # @param session [::String] - # The session resource name. Not required. - # - # When session field is not set, the API is in sessionless mode. - # - # We support auto session mode: users can use the wildcard symbol `-` as - # session ID. A new ID will be automatically generated and assigned. - # @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash] - # Model specification. - # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash] - # Related questions specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec, ::Hash] - # Optional. Grounding specification. - # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash] - # Answer generation specification. - # @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash] - # Search specification. - # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash] - # Query understanding specification. - # @param asynchronous_mode [::Boolean] - # Deprecated: This field is deprecated. Streaming Answer API will be - # supported. - # - # Asynchronous mode control. - # - # If enabled, the response will be returned with answer/session resource - # name without final answer. The API users need to do the polling to get - # the latest status of answer/session by calling - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_answer ConversationalSearchService.GetAnswer} - # or - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client#get_session ConversationalSearchService.GetSession} - # method. - # @param user_pseudo_id [::String] - # 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`. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param end_user_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec, ::Hash] - # Optional. End user specification. - # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - # - # # Call the stream_answer_query method to start streaming. - # output = client.stream_answer_query request - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse - # output.each do |current_response| - # p current_response - # end - # - def stream_answer_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.stream_answer_query.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.stream_answer_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stream_answer_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - ::Gapic::Rest::ServerStream.new( - ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, - ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q| - @conversational_search_service_stub.stream_answer_query request, options do |chunk| - in_q.deq - out_q.enq chunk - end - end - ) - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Answer. - # - # @overload get_answer(request, options = nil) - # Pass arguments to `get_answer` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_answer(name: nil) - # Pass arguments to `get_answer` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Answer to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new - # - # # Call the get_answer method. - # result = client.get_answer request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. - # p result - # - def get_answer request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_answer.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_answer.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_answer.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.get_answer request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_session(parent: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The session to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.create_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.delete_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Session. - # - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_session(request, options = nil) - # Pass arguments to `update_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_session(session: nil, update_mask: nil) - # Pass arguments to `update_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The Session to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - # - # # Call the update_session method. - # result = client.update_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def update_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.update_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_session(name: nil, include_answer_details: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @param include_answer_details [::Boolean] - # Optional. If set to true, the full session including all answer details - # will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.get_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Sessions by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSessions` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A comma-separated list of fields to filter by, in EBNF grammar. - # The supported fields are: - # * `user_pseudo_id` - # * `state` - # * `display_name` - # * `starred` - # * `is_pinned` - # * `labels` - # * `create_time` - # * `update_time` - # - # Examples: - # "user_pseudo_id = some_id" - # "display_name = \"some_name\"" - # "starred = true" - # "is_pinned=true AND (NOT labels:hidden)" - # "create_time > \"1970-01-01T12:00:00Z\"" - # @param order_by [::String] - # 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` - # * `session_name` - # * `is_pinned` - # - # Example: - # - # * "update_time desc" - # * "create_time" - # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then - # by update_time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversational_search_service_stub.list_sessions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, "sessions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ConversationalSearchService REST API. - # - # This class represents the configuration for ConversationalSearchService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # converse_conversation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.converse_conversation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.converse_conversation.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ConversationalSearchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `converse_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :converse_conversation - ## - # RPC-specific configuration for `create_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation - ## - # RPC-specific configuration for `delete_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation - ## - # RPC-specific configuration for `update_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_conversation - ## - # RPC-specific configuration for `get_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation - ## - # RPC-specific configuration for `list_conversations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversations - ## - # RPC-specific configuration for `answer_query` - # @return [::Gapic::Config::Method] - # - attr_reader :answer_query - ## - # RPC-specific configuration for `stream_answer_query` - # @return [::Gapic::Config::Method] - # - attr_reader :stream_answer_query - ## - # RPC-specific configuration for `get_answer` - # @return [::Gapic::Config::Method] - # - attr_reader :get_answer - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `update_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - - # @private - def initialize parent_rpcs = nil - converse_conversation_config = parent_rpcs.converse_conversation if parent_rpcs.respond_to? :converse_conversation - @converse_conversation = ::Gapic::Config::Method.new converse_conversation_config - create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation - @create_conversation = ::Gapic::Config::Method.new create_conversation_config - delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation - @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config - update_conversation_config = parent_rpcs.update_conversation if parent_rpcs.respond_to? :update_conversation - @update_conversation = ::Gapic::Config::Method.new update_conversation_config - get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation - @get_conversation = ::Gapic::Config::Method.new get_conversation_config - list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations - @list_conversations = ::Gapic::Config::Method.new list_conversations_config - answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query - @answer_query = ::Gapic::Config::Method.new answer_query_config - stream_answer_query_config = parent_rpcs.stream_answer_query if parent_rpcs.respond_to? :stream_answer_query - @stream_answer_query = ::Gapic::Config::Method.new stream_answer_query_config - get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer - @get_answer = ::Gapic::Config::Method.new get_answer_config - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session - @update_session = ::Gapic::Config::Method.new update_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb deleted file mode 100644 index b32da44ebdd2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +++ /dev/null @@ -1,1146 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/conversational_search_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - module Rest - ## - # REST service stub for the ConversationalSearchService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the converse_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] - # A result object deserialized from the server's reply - def converse_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_converse_conversation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "converse_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # A result object deserialized from the server's reply - def create_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # A result object deserialized from the server's reply - def update_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_conversation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # A result object deserialized from the server's reply - def get_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_conversations REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse] - # A result object deserialized from the server's reply - def list_conversations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_conversations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_conversations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the answer_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse] - # A result object deserialized from the server's reply - def answer_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_answer_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "answer_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stream_answer_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yieldparam chunk [::String] The chunk of data received during server streaming. - # - # @return [::Gapic::Rest::TransportOperation] - def stream_answer_query(request_pb, options = nil, &) - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stream_answer_query_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "stream_answer_query", - options: options, - is_server_streaming: true, - & - ) - ::Gapic::Rest::TransportOperation.new response - end - - ## - # Baseline implementation for the get_answer REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Answer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] - # A result object deserialized from the server's reply - def get_answer request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_answer_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_answer", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Answer.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def create_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def update_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def get_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] - # A result object deserialized from the server's reply - def list_sessions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_sessions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the converse_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_converse_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:converse", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:converse", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:converse", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/conversations", - body: "conversation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/conversations", - body: "conversation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/conversations", - body: "conversation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{conversation.name}", - body: "conversation", - matches: [ - ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{conversation.name}", - body: "conversation", - matches: [ - ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{conversation.name}", - body: "conversation", - matches: [ - ["conversation.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_conversations REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_conversations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/conversations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/conversations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/conversations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the answer_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_answer_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:answer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:answer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:answer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stream_answer_query REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stream_answer_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:streamAnswer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:streamAnswer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:streamAnswer", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_answer REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_answer_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/answers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_sessions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb deleted file mode 100644 index fd1ee755d3f8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/data_store_service/credentials" -require "google/cloud/discovery_engine/v1/data_store_service/paths" -require "google/cloud/discovery_engine/v1/data_store_service/operations" -require "google/cloud/discovery_engine/v1/data_store_service/client" -require "google/cloud/discovery_engine/v1/data_store_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # configuration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/data_store_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/data_store_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - module DataStoreService - end - end - end - end -end - -helper_path = ::File.join __dir__, "data_store_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/data_store_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb deleted file mode 100644 index 0c812d7e86ae..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +++ /dev/null @@ -1,1000 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/data_store_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - ## - # Client for the DataStoreService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :data_store_service_stub - - ## - # Configure the DataStoreService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DataStoreService clients - # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DataStoreService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @data_store_service_stub.universe_domain - end - - ## - # Create a new DataStoreService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DataStoreService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/data_store_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @data_store_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @data_store_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @data_store_service_stub.endpoint - config.universe_domain = @data_store_service_stub.universe_domain - config.logger = @data_store_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @data_store_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # DataStore is for storing - # {::Google::Cloud::DiscoveryEngine::V1::Document Documents}. To serve these - # documents for Search, or Recommendation use case, an - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} needs to be created - # separately. - # - # @overload create_data_store(request, options = nil) - # Pass arguments to `create_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_data_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) - # Pass arguments to `create_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cmek_config_name [::String] - # Resource name of the CmekConfig to use for protecting this DataStore. - # - # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param disable_cmek [::Boolean] - # DataStore without CMEK protections. If a default CmekConfig is set for - # the project, setting this field will override the default CmekConfig as - # well. - # - # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # create. - # @param data_store_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become - # the final component of the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. - # - # 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. - # @param create_advanced_site_search [::Boolean] - # A boolean flag indicating whether user want to directly create an advanced - # data store for site search. - # If the data store is not configured as site - # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will - # be ignored. - # @param skip_default_schema_creation [::Boolean] - # A boolean flag indicating whether to skip the default schema creation for - # the data store. Only enable this flag if you are certain that the default - # schema is incompatible with your use case. - # - # If set to true, you must manually create a schema for the data store before - # any documents can be ingested. - # - # This flag cannot be specified if `data_store.starting_schema` is specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new - # - # # Call the create_data_store method. - # result = client.create_data_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_data_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.call_rpc :create_data_store, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload get_data_store(request, options = nil) - # Pass arguments to `get_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_data_store(name: nil) - # Pass arguments to `get_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # does not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new - # - # # Call the get_data_store method. - # result = client.get_data_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - # p result - # - def get_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_data_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.call_rpc :get_data_store, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s - # associated with the project. - # - # @overload list_data_stores(request, options = nil) - # Pass arguments to `list_data_stores` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_data_stores` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this - # location, regardless of whether or not this data store exists, a - # PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s - # to return. If unspecified, defaults to 10. The maximum allowed value is 50. - # Values above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param filter [::String] - # Filter by solution type . - # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new - # - # # Call the list_data_stores method. - # result = client.list_data_stores request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. - # p item - # end - # - def list_data_stores request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_data_stores.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_data_stores.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.call_rpc :list_data_stores, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @data_store_service_stub, :list_data_stores, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload delete_data_store(request, options = nil) - # Pass arguments to `delete_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_data_store(name: nil) - # Pass arguments to `delete_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete - # does not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new - # - # # Call the delete_data_store method. - # result = client.delete_data_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.call_rpc :delete_data_store, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # - # @overload update_data_store(request, options = nil) - # Pass arguments to `update_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_data_store(data_store: nil, update_mask: nil) - # Pass arguments to `update_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update - # does not exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new - # - # # Call the update_data_store method. - # result = client.update_data_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - # p result - # - def update_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.data_store&.name - header_params["data_store.name"] = request.data_store.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_data_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.call_rpc :update_data_store, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DataStoreService API. - # - # This class represents the configuration for DataStoreService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_data_store to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_data_store.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_data_store.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the DataStoreService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :create_data_store - ## - # RPC-specific configuration for `get_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :get_data_store - ## - # RPC-specific configuration for `list_data_stores` - # @return [::Gapic::Config::Method] - # - attr_reader :list_data_stores - ## - # RPC-specific configuration for `delete_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_data_store - ## - # RPC-specific configuration for `update_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :update_data_store - - # @private - def initialize parent_rpcs = nil - create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store - @create_data_store = ::Gapic::Config::Method.new create_data_store_config - get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store - @get_data_store = ::Gapic::Config::Method.new get_data_store_config - list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores - @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config - delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store - @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config - update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store - @update_data_store = ::Gapic::Config::Method.new update_data_store_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb deleted file mode 100644 index efcc9e826944..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - # Credentials for the DataStoreService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb deleted file mode 100644 index 837ad6879784..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DataStoreService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DataStoreService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb deleted file mode 100644 index 3a4abf733e7c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +++ /dev/null @@ -1,295 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - # Path helper methods for the DataStoreService API. - module Paths - ## - # Create a fully-qualified CmekConfig resource string. - # - # @overload cmek_config_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfig` - # - # @param project [String] - # @param location [String] - # - # @overload cmek_config_path(project:, location:, cmek_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` - # - # @param project [String] - # @param location [String] - # @param cmek_config [String] - # - # @return [::String] - def cmek_config_path **args - resources = { - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfig" - end), - "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Collection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # - # @return [::String] - def collection_path project:, location:, collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}" - end - - ## - # Create a fully-qualified CryptoKeyVersions resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified CryptoKeys resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_keys_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified DocumentProcessingConfig resource string. - # - # @overload document_processing_config_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload document_processing_config_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def document_processing_config_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/documentProcessingConfig" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/documentProcessingConfig" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified IdentityMappingStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}` - # - # @param project [String] - # @param location [String] - # @param identity_mapping_store [String] - # - # @return [::String] - def identity_mapping_store_path project:, location:, identity_mapping_store: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/identityMappingStores/#{identity_mapping_store}" - end - - ## - # Create a fully-qualified Schema resource string. - # - # @overload schema_path(project:, location:, data_store:, schema:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param schema [String] - # - # @overload schema_path(project:, location:, collection:, data_store:, schema:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param schema [String] - # - # @return [::String] - def schema_path **args - resources = { - "data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/schemas/#{schema}" - end), - "collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/schemas/#{schema}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb deleted file mode 100644 index bdbe57c88f2c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/data_store_service/credentials" -require "google/cloud/discovery_engine/v1/data_store_service/paths" -require "google/cloud/discovery_engine/v1/data_store_service/rest/operations" -require "google/cloud/discovery_engine/v1/data_store_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # configuration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/data_store_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - module DataStoreService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/data_store_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb deleted file mode 100644 index d460e14bc845..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +++ /dev/null @@ -1,922 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/data_store_service_pb" -require "google/cloud/discovery_engine/v1/data_store_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - module Rest - ## - # REST client for the DataStoreService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :data_store_service_stub - - ## - # Configure the DataStoreService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DataStoreService clients - # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DataStoreService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @data_store_service_stub.universe_domain - end - - ## - # Create a new DataStoreService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DataStoreService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @data_store_service_stub = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @data_store_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @data_store_service_stub.endpoint - config.universe_domain = @data_store_service_stub.universe_domain - config.logger = @data_store_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @data_store_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # DataStore is for storing - # {::Google::Cloud::DiscoveryEngine::V1::Document Documents}. To serve these - # documents for Search, or Recommendation use case, an - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} needs to be created - # separately. - # - # @overload create_data_store(request, options = nil) - # Pass arguments to `create_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_data_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) - # Pass arguments to `create_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cmek_config_name [::String] - # Resource name of the CmekConfig to use for protecting this DataStore. - # - # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param disable_cmek [::Boolean] - # DataStore without CMEK protections. If a default CmekConfig is set for - # the project, setting this field will override the default CmekConfig as - # well. - # - # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # create. - # @param data_store_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become - # the final component of the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. - # - # 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. - # @param create_advanced_site_search [::Boolean] - # A boolean flag indicating whether user want to directly create an advanced - # data store for site search. - # If the data store is not configured as site - # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will - # be ignored. - # @param skip_default_schema_creation [::Boolean] - # A boolean flag indicating whether to skip the default schema creation for - # the data store. Only enable this flag if you are certain that the default - # schema is incompatible with your use case. - # - # If set to true, you must manually create a schema for the data store before - # any documents can be ingested. - # - # This flag cannot be specified if `data_store.starting_schema` is specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new - # - # # Call the create_data_store method. - # result = client.create_data_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_data_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.create_data_store request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload get_data_store(request, options = nil) - # Pass arguments to `get_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_data_store(name: nil) - # Pass arguments to `get_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # does not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new - # - # # Call the get_data_store method. - # result = client.get_data_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - # p result - # - def get_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_data_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.get_data_store request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s - # associated with the project. - # - # @overload list_data_stores(request, options = nil) - # Pass arguments to `list_data_stores` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_data_stores` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this - # location, regardless of whether or not this data store exists, a - # PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s - # to return. If unspecified, defaults to 10. The maximum allowed value is 50. - # Values above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client#list_data_stores DataStoreService.ListDataStores} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client#list_data_stores DataStoreService.ListDataStores} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @param filter [::String] - # Filter by solution type . - # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new - # - # # Call the list_data_stores method. - # result = client.list_data_stores request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. - # p item - # end - # - def list_data_stores request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_data_stores.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_data_stores.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.list_data_stores request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @data_store_service_stub, :list_data_stores, "data_stores", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload delete_data_store(request, options = nil) - # Pass arguments to `delete_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_data_store(name: nil) - # Pass arguments to `delete_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete - # does not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new - # - # # Call the delete_data_store method. - # result = client.delete_data_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.delete_data_store request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # - # @overload update_data_store(request, options = nil) - # Pass arguments to `update_data_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_data_store(data_store: nil, update_mask: nil) - # Pass arguments to `update_data_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update - # does not exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new - # - # # Call the update_data_store method. - # result = client.update_data_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - # p result - # - def update_data_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_data_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_data_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_data_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @data_store_service_stub.update_data_store request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DataStoreService REST API. - # - # This class represents the configuration for DataStoreService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_data_store to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_data_store.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_data_store.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the DataStoreService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :create_data_store - ## - # RPC-specific configuration for `get_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :get_data_store - ## - # RPC-specific configuration for `list_data_stores` - # @return [::Gapic::Config::Method] - # - attr_reader :list_data_stores - ## - # RPC-specific configuration for `delete_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_data_store - ## - # RPC-specific configuration for `update_data_store` - # @return [::Gapic::Config::Method] - # - attr_reader :update_data_store - - # @private - def initialize parent_rpcs = nil - create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store - @create_data_store = ::Gapic::Config::Method.new create_data_store_config - get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store - @get_data_store = ::Gapic::Config::Method.new get_data_store_config - list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores - @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config - delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store - @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config - update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store - @update_data_store = ::Gapic::Config::Method.new update_data_store_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb deleted file mode 100644 index f66faa75a690..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DataStoreService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DataStoreService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb deleted file mode 100644 index 8563e28526bc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb +++ /dev/null @@ -1,425 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/data_store_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DataStoreService - module Rest - ## - # REST service stub for the DataStoreService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_data_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_data_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_data_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # A result object deserialized from the server's reply - def get_data_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_data_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_data_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_data_stores REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse] - # A result object deserialized from the server's reply - def list_data_stores request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_data_stores_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_data_stores", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_data_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_data_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # A result object deserialized from the server's reply - def update_data_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_data_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_data_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_data_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/dataStores", - body: "data_store", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/dataStores", - body: "data_store", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_data_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_data_stores REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_data_stores_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/dataStores", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/dataStores", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_data_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_data_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_data_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{data_store.name}", - body: "data_store", - matches: [ - ["data_store.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{data_store.name}", - body: "data_store", - matches: [ - ["data_store.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb deleted file mode 100644 index 0d6246e410ff..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/document_service/credentials" -require "google/cloud/discovery_engine/v1/document_service/paths" -require "google/cloud/discovery_engine/v1/document_service/operations" -require "google/cloud/discovery_engine/v1/document_service/client" -require "google/cloud/discovery_engine/v1/document_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} - # information of the customer's website. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/document_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/document_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - module DocumentService - end - end - end - end -end - -helper_path = ::File.join __dir__, "document_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/document_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb deleted file mode 100644 index 424824cff98f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb +++ /dev/null @@ -1,1426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/document_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - ## - # Client for the DocumentService service. - # - # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} - # information of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :document_service_stub - - ## - # Configure the DocumentService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentService clients - # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.import_documents.timeout = 300.0 - default_config.rpcs.import_documents.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @document_service_stub.universe_domain - end - - ## - # Create a new DocumentService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/document_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @document_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @document_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @document_service_stub.endpoint - config.universe_domain = @document_service_stub.universe_domain - config.logger = @document_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @document_service_stub.logger - end - - # Service calls - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_document(name: nil) - # Pass arguments to `get_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does - # not exist, a `NOT_FOUND` error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :get_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_documents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, - # regardless of whether or not this branch exists, a `PERMISSION_DENIED` - # error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. If unspecified, defaults to 100. The maximum allowed value is 1000. - # Values above 1000 are set to 1000. - # - # If this field is negative, an `INVALID_ARGUMENT` error is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new - # - # # Call the list_documents method. - # result = client.list_documents request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. - # p item - # end - # - def list_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :list_documents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @document_service_stub, :list_documents, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_document(parent: nil, document: nil, document_id: nil) - # Pass arguments to `create_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to - # create. - # @param document_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the - # final component of the - # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # This field must be unique among all - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same - # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def create_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :create_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_document(document: nil, allow_missing: nil, update_mask: nil) - # Pass arguments to `update_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] - # Required. The document to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does - # not exist and - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} - # is not set, a `NOT_FOUND` error is returned. - # @param allow_missing [::Boolean] - # If set to `true` and the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported 'document' to update. If - # not set, by default updates all fields. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def update_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.document&.name - header_params["document.name"] = request.document.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :update_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_document(name: nil) - # Pass arguments to `delete_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does - # not exist, a `NOT_FOUND` error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :delete_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Bulk import of multiple - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Request processing - # may be synchronous. Non-existing items are created. - # - # Note: It is possible for a subset of the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be successfully - # updated. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) - # Pass arguments to `import_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource, ::Hash] - # The Inline source for the input content for documents. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param fhir_store_source [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource, ::Hash] - # FhirStore input source. - # - # Note: The following parameters are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param spanner_source [::Google::Cloud::DiscoveryEngine::V1::SpannerSource, ::Hash] - # Spanner input source. - # - # Note: The following parameters are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param cloud_sql_source [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource, ::Hash] - # Cloud SQL input source. - # - # Note: The following parameters are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource, ::Hash] - # Firestore input source. - # - # Note: The following parameters are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource, ::Hash] - # AlloyDB input source. - # - # Note: The following parameters are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1::BigtableSource, ::Hash] - # Cloud Bigtable input source. - # - # Note: The following parameters are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # Requires create/update permission. - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. - # @param reconciliation_mode [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] - # The mode of reconciliation between existing documents and the documents to - # be imported. Defaults to - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported documents to update. If - # not set, the default is to update all fields. - # @param auto_generate_ids [::Boolean] - # Whether to automatically generate IDs for the documents if absent. - # - # If set to `true`, - # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} - # is highly recommended to avoid duplicate contents. If unset or set to - # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have - # to be specified using - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, - # otherwise, documents without IDs fail to be imported. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @param id_field [::String] - # The field indicates the ID field or column to be used as unique IDs of - # the documents. - # - # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of - # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. - # For others, it may be the column name of the table where the unique ids are - # stored. - # - # The values of the JSON field or the table column are used as the - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field - # or the table 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @param force_refresh_content [::Boolean] - # Optional. Whether to force refresh the unstructured content of the - # documents. - # - # If set to `true`, the content part of the documents will be refreshed - # regardless of the update status of the referencing content. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :import_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all selected - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s in a branch. - # - # This process is asynchronous. Depending on the number of - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be deleted, this - # operation can take hours to complete. Before the delete operation - # completes, some {::Google::Cloud::DiscoveryEngine::V1::Document Document}s might - # still be returned by - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} - # or - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments}. - # - # To get a list of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s - # to be deleted, set - # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest#force PurgeDocumentsRequest.force} - # to false. - # - # @overload purge_documents(request, options = nil) - # Pass arguments to `purge_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) - # Pass arguments to `purge_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # Supported `data_schema`: - # * `document_id`: One valid - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource, ::Hash] - # Inline source for the input content for purge. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param filter [::String] - # Required. Filter matching documents to purge. Only currently supported - # value is - # `*` (all items). - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig, ::Hash] - # The desired location of errors incurred during the purge. - # @param force [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any documents. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new - # - # # Call the purge_documents method. - # result = client.purge_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.purge_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.purge_documents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :purge_documents, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets index freshness metadata for - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Supported for - # website search only. - # - # @overload batch_get_documents_metadata(request, options = nil) - # Pass arguments to `batch_get_documents_metadata` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_get_documents_metadata(parent: nil, matcher: nil) - # Pass arguments to `batch_get_documents_metadata` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param matcher [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher, ::Hash] - # Required. Matcher for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new - # - # # Call the batch_get_documents_metadata method. - # result = client.batch_get_documents_metadata request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. - # p result - # - def batch_get_documents_metadata request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_get_documents_metadata.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_get_documents_metadata.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_get_documents_metadata.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.call_rpc :batch_get_documents_metadata, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentService API. - # - # This class represents the configuration for DocumentService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the DocumentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `purge_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_documents - ## - # RPC-specific configuration for `batch_get_documents_metadata` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_documents_metadata - - # @private - def initialize parent_rpcs = nil - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_document_config - update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document - @update_document = ::Gapic::Config::Method.new update_document_config - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_document_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - purge_documents_config = parent_rpcs.purge_documents if parent_rpcs.respond_to? :purge_documents - @purge_documents = ::Gapic::Config::Method.new purge_documents_config - batch_get_documents_metadata_config = parent_rpcs.batch_get_documents_metadata if parent_rpcs.respond_to? :batch_get_documents_metadata - @batch_get_documents_metadata = ::Gapic::Config::Method.new batch_get_documents_metadata_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb deleted file mode 100644 index 68be7028f336..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - # Credentials for the DocumentService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb deleted file mode 100644 index 599b9ead6f54..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb deleted file mode 100644 index 56ab199c40b4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/paths.rb +++ /dev/null @@ -1,181 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - # Path helper methods for the DocumentService API. - module Paths - ## - # Create a fully-qualified Branch resource string. - # - # @overload branch_path(project:, location:, data_store:, branch:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # - # @overload branch_path(project:, location:, collection:, data_store:, branch:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # - # @return [::String] - def branch_path **args - resources = { - "branch:data_store:location:project" => (proc do |project:, location:, data_store:, branch:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}" - end), - "branch:collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, branch:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified FhirResource resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # @param fhir_store [String] - # @param resource_type [String] - # @param fhir_resource_id [String] - # - # @return [::String] - def fhir_resource_path project:, location:, dataset:, fhir_store:, resource_type:, fhir_resource_id: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" - raise ::ArgumentError, "fhir_store cannot contain /" if fhir_store.to_s.include? "/" - raise ::ArgumentError, "resource_type cannot contain /" if resource_type.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasets/#{dataset}/fhirStores/#{fhir_store}/fhir/#{resource_type}/#{fhir_resource_id}" - end - - ## - # Create a fully-qualified FhirStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # @param fhir_store [String] - # - # @return [::String] - def fhir_store_path project:, location:, dataset:, fhir_store: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasets/#{dataset}/fhirStores/#{fhir_store}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb deleted file mode 100644 index 1bdbcdae81fa..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/document_service/credentials" -require "google/cloud/discovery_engine/v1/document_service/paths" -require "google/cloud/discovery_engine/v1/document_service/rest/operations" -require "google/cloud/discovery_engine/v1/document_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} - # information of the customer's website. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/document_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - module DocumentService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/document_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb deleted file mode 100644 index 256d536216f7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +++ /dev/null @@ -1,1327 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/document_service_pb" -require "google/cloud/discovery_engine/v1/document_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - module Rest - ## - # REST client for the DocumentService service. - # - # Service for ingesting {::Google::Cloud::DiscoveryEngine::V1::Document Document} - # information of the customer's website. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :document_service_stub - - ## - # Configure the DocumentService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all DocumentService clients - # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.import_documents.timeout = 300.0 - default_config.rpcs.import_documents.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @document_service_stub.universe_domain - end - - ## - # Create a new DocumentService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the DocumentService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @document_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @document_service_stub.endpoint - config.universe_domain = @document_service_stub.universe_domain - config.logger = @document_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @document_service_stub.logger - end - - # Service calls - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_document(name: nil) - # Pass arguments to `get_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does - # not exist, a `NOT_FOUND` error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def get_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.get_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_documents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, - # regardless of whether or not this branch exists, a `PERMISSION_DENIED` - # error is returned. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. If unspecified, defaults to 100. The maximum allowed value is 1000. - # Values above 1000 are set to 1000. - # - # If this field is negative, an `INVALID_ARGUMENT` error is returned. - # @param page_token [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new - # - # # Call the list_documents method. - # result = client.list_documents request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. - # p item - # end - # - def list_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.list_documents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @document_service_stub, :list_documents, "documents", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_document(parent: nil, document: nil, document_id: nil) - # Pass arguments to `create_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to - # create. - # @param document_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the - # final component of the - # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # This field must be unique among all - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same - # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def create_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.create_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_document(document: nil, allow_missing: nil, update_mask: nil) - # Pass arguments to `update_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param document [::Google::Cloud::DiscoveryEngine::V1::Document, ::Hash] - # Required. The document to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does - # not exist and - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} - # is not set, a `NOT_FOUND` error is returned. - # @param allow_missing [::Boolean] - # If set to `true` and the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported 'document' to update. If - # not set, by default updates all fields. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - # p result - # - def update_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.update_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_document(name: nil) - # Pass arguments to `delete_document` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does - # not exist, a `NOT_FOUND` error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_document.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.delete_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Bulk import of multiple - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Request processing - # may be synchronous. Non-existing items are created. - # - # Note: It is possible for a subset of the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be successfully - # updated. - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) - # Pass arguments to `import_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource, ::Hash] - # The Inline source for the input content for documents. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param fhir_store_source [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource, ::Hash] - # FhirStore input source. - # - # Note: The following parameters are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param spanner_source [::Google::Cloud::DiscoveryEngine::V1::SpannerSource, ::Hash] - # Spanner input source. - # - # Note: The following parameters are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param cloud_sql_source [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource, ::Hash] - # Cloud SQL input source. - # - # Note: The following parameters are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param firestore_source [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource, ::Hash] - # Firestore input source. - # - # Note: The following parameters are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param alloy_db_source [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource, ::Hash] - # AlloyDB input source. - # - # Note: The following parameters are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigtable_source [::Google::Cloud::DiscoveryEngine::V1::BigtableSource, ::Hash] - # Cloud Bigtable input source. - # - # Note: The following parameters are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # Requires create/update permission. - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. - # @param reconciliation_mode [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] - # The mode of reconciliation between existing documents and the documents to - # be imported. Defaults to - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided imported documents to update. If - # not set, the default is to update all fields. - # @param auto_generate_ids [::Boolean] - # Whether to automatically generate IDs for the documents if absent. - # - # If set to `true`, - # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} - # is highly recommended to avoid duplicate contents. If unset or set to - # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have - # to be specified using - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, - # otherwise, documents without IDs fail to be imported. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @param id_field [::String] - # The field indicates the ID field or column to be used as unique IDs of - # the documents. - # - # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of - # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. - # For others, it may be the column name of the table where the unique ids are - # stored. - # - # The values of the JSON field or the table column are used as the - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field - # or the table 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @param force_refresh_content [::Boolean] - # Optional. Whether to force refresh the unstructured content of the - # documents. - # - # If set to `true`, the content part of the documents will be refreshed - # regardless of the update status of the referencing content. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new - # - # # Call the import_documents method. - # result = client.import_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.import_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes all selected - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s in a branch. - # - # This process is asynchronous. Depending on the number of - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be deleted, this - # operation can take hours to complete. Before the delete operation - # completes, some {::Google::Cloud::DiscoveryEngine::V1::Document Document}s might - # still be returned by - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#get_document DocumentService.GetDocument} - # or - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments}. - # - # To get a list of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s - # to be deleted, set - # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest#force PurgeDocumentsRequest.force} - # to false. - # - # @overload purge_documents(request, options = nil) - # Pass arguments to `purge_documents` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) - # Pass arguments to `purge_documents` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # Supported `data_schema`: - # * `document_id`: One valid - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource, ::Hash] - # Inline source for the input content for purge. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param filter [::String] - # Required. Filter matching documents to purge. Only currently supported - # value is - # `*` (all items). - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig, ::Hash] - # The desired location of errors incurred during the purge. - # @param force [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any documents. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new - # - # # Call the purge_documents method. - # result = client.purge_documents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_documents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.purge_documents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_documents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_documents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.purge_documents request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets index freshness metadata for - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Supported for - # website search only. - # - # @overload batch_get_documents_metadata(request, options = nil) - # Pass arguments to `batch_get_documents_metadata` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_get_documents_metadata(parent: nil, matcher: nil) - # Pass arguments to `batch_get_documents_metadata` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @param matcher [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher, ::Hash] - # Required. Matcher for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new - # - # # Call the batch_get_documents_metadata method. - # result = client.batch_get_documents_metadata request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. - # p result - # - def batch_get_documents_metadata request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_get_documents_metadata.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_get_documents_metadata.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_get_documents_metadata.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @document_service_stub.batch_get_documents_metadata request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the DocumentService REST API. - # - # This class represents the configuration for DocumentService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_document to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_document.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the DocumentService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `purge_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_documents - ## - # RPC-specific configuration for `batch_get_documents_metadata` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_get_documents_metadata - - # @private - def initialize parent_rpcs = nil - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_document_config - update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document - @update_document = ::Gapic::Config::Method.new update_document_config - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_document_config - import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents - @import_documents = ::Gapic::Config::Method.new import_documents_config - purge_documents_config = parent_rpcs.purge_documents if parent_rpcs.respond_to? :purge_documents - @purge_documents = ::Gapic::Config::Method.new purge_documents_config - batch_get_documents_metadata_config = parent_rpcs.batch_get_documents_metadata if parent_rpcs.respond_to? :batch_get_documents_metadata - @batch_get_documents_metadata = ::Gapic::Config::Method.new batch_get_documents_metadata_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb deleted file mode 100644 index 156d919282c9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the DocumentService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the DocumentService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb deleted file mode 100644 index 0a8a222d6448..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/service_stub.rb +++ /dev/null @@ -1,633 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/document_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - module Rest - ## - # REST service stub for the DocumentService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # A result object deserialized from the server's reply - def get_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse] - # A result object deserialized from the server's reply - def list_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_documents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # A result object deserialized from the server's reply - def create_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # A result object deserialized from the server's reply - def update_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Document.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_document_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_documents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def purge_documents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_documents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "purge_documents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_get_documents_metadata REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse] - # A result object deserialized from the server's reply - def batch_get_documents_metadata request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_documents_metadata_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_get_documents_metadata", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/documents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/documents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_document REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_documents REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_documents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/documents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_get_documents_metadata REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_get_documents_metadata_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/batchGetDocumentsMetadata", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/batchGetDocumentsMetadata", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb deleted file mode 100644 index f57da3bbc668..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/engine_service/credentials" -require "google/cloud/discovery_engine/v1/engine_service/paths" -require "google/cloud/discovery_engine/v1/engine_service/operations" -require "google/cloud/discovery_engine/v1/engine_service/client" -require "google/cloud/discovery_engine/v1/engine_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # configuration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/engine_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/engine_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - module EngineService - end - end - end - end -end - -helper_path = ::File.join __dir__, "engine_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/engine_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb deleted file mode 100644 index dac37a116c03..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +++ /dev/null @@ -1,942 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/engine_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - ## - # Client for the EngineService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :engine_service_stub - - ## - # Configure the EngineService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EngineService clients - # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EngineService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @engine_service_stub.universe_domain - end - - ## - # Create a new EngineService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EngineService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/engine_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @engine_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @engine_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @engine_service_stub.endpoint - config.universe_domain = @engine_service_stub.universe_domain - config.logger = @engine_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @engine_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload create_engine(request, options = nil) - # Pass arguments to `create_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_engine(parent: nil, engine: nil, engine_id: nil) - # Pass arguments to `create_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. - # @param engine_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the - # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s - # resource name. - # - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new - # - # # Call the create_engine method. - # result = client.create_engine request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_engine.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.call_rpc :create_engine, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload delete_engine(request, options = nil) - # Pass arguments to `delete_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_engine(name: nil) - # Pass arguments to `delete_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not - # exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new - # - # # Call the delete_engine method. - # result = client.delete_engine request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_engine.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.call_rpc :delete_engine, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # - # @overload update_engine(request, options = nil) - # Pass arguments to `update_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_engine(engine: nil, update_mask: nil) - # Pass arguments to `update_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not - # exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new - # - # # Call the update_engine method. - # result = client.update_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - # p result - # - def update_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.engine&.name - header_params["engine.name"] = request.engine.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_engine.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.call_rpc :update_engine, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload get_engine(request, options = nil) - # Pass arguments to `get_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_engine(name: nil) - # Pass arguments to `get_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new - # - # # Call the get_engine method. - # result = client.get_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - # p result - # - def get_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_engine.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.call_rpc :get_engine, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s associated - # with the project. - # - # @overload list_engines(request, options = nil) - # Pass arguments to `list_engines` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_engines` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # @param page_size [::Integer] - # Optional. Not supported. - # @param page_token [::String] - # Optional. Not supported. - # @param filter [::String] - # Optional. Filter by solution type. For example: - # solution_type=SOLUTION_TYPE_SEARCH - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new - # - # # Call the list_engines method. - # result = client.list_engines request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. - # p item - # end - # - def list_engines request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_engines.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_engines.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_engines.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.call_rpc :list_engines, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @engine_service_stub, :list_engines, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EngineService API. - # - # This class represents the configuration for EngineService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_engine to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_engine.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_engine.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the EngineService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :create_engine - ## - # RPC-specific configuration for `delete_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_engine - ## - # RPC-specific configuration for `update_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :update_engine - ## - # RPC-specific configuration for `get_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :get_engine - ## - # RPC-specific configuration for `list_engines` - # @return [::Gapic::Config::Method] - # - attr_reader :list_engines - - # @private - def initialize parent_rpcs = nil - create_engine_config = parent_rpcs.create_engine if parent_rpcs.respond_to? :create_engine - @create_engine = ::Gapic::Config::Method.new create_engine_config - delete_engine_config = parent_rpcs.delete_engine if parent_rpcs.respond_to? :delete_engine - @delete_engine = ::Gapic::Config::Method.new delete_engine_config - update_engine_config = parent_rpcs.update_engine if parent_rpcs.respond_to? :update_engine - @update_engine = ::Gapic::Config::Method.new update_engine_config - get_engine_config = parent_rpcs.get_engine if parent_rpcs.respond_to? :get_engine - @get_engine = ::Gapic::Config::Method.new get_engine_config - list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines - @list_engines = ::Gapic::Config::Method.new list_engines_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb deleted file mode 100644 index 409d5568acf4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - # Credentials for the EngineService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb deleted file mode 100644 index 5b667323c6b4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EngineService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the EngineService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb deleted file mode 100644 index dbad2dd5b2d0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - # Path helper methods for the EngineService API. - module Paths - ## - # Create a fully-qualified Collection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # - # @return [::String] - def collection_path project:, location:, collection: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}" - end - - ## - # Create a fully-qualified Engine resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # - # @return [::String] - def engine_path project:, location:, collection:, engine: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb deleted file mode 100644 index 207c2f84013f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/engine_service/credentials" -require "google/cloud/discovery_engine/v1/engine_service/paths" -require "google/cloud/discovery_engine/v1/engine_service/rest/operations" -require "google/cloud/discovery_engine/v1/engine_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # configuration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/engine_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - module EngineService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/engine_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb deleted file mode 100644 index 08ac6e4d954b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +++ /dev/null @@ -1,864 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/engine_service_pb" -require "google/cloud/discovery_engine/v1/engine_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - module Rest - ## - # REST client for the EngineService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # configuration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :engine_service_stub - - ## - # Configure the EngineService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EngineService clients - # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EngineService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @engine_service_stub.universe_domain - end - - ## - # Create a new EngineService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EngineService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @engine_service_stub = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @engine_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @engine_service_stub.endpoint - config.universe_domain = @engine_service_stub.universe_domain - config.logger = @engine_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @engine_service_stub.logger - end - - # Service calls - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload create_engine(request, options = nil) - # Pass arguments to `create_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_engine(parent: nil, engine: nil, engine_id: nil) - # Pass arguments to `create_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. - # @param engine_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the - # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s - # resource name. - # - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new - # - # # Call the create_engine method. - # result = client.create_engine request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_engine.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.create_engine request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload delete_engine(request, options = nil) - # Pass arguments to `delete_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_engine(name: nil) - # Pass arguments to `delete_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not - # exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new - # - # # Call the delete_engine method. - # result = client.delete_engine request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_engine.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.delete_engine request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} - # - # @overload update_engine(request, options = nil) - # Pass arguments to `update_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_engine(engine: nil, update_mask: nil) - # Pass arguments to `update_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param engine [::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not - # exist, a NOT_FOUND error is returned. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new - # - # # Call the update_engine method. - # result = client.update_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - # p result - # - def update_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_engine.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.update_engine request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # - # @overload get_engine(request, options = nil) - # Pass arguments to `get_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_engine(name: nil) - # Pass arguments to `get_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new - # - # # Call the get_engine method. - # result = client.get_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - # p result - # - def get_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_engine.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.get_engine request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s associated - # with the project. - # - # @overload list_engines(request, options = nil) - # Pass arguments to `list_engines` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_engines` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # @param page_size [::Integer] - # Optional. Not supported. - # @param page_token [::String] - # Optional. Not supported. - # @param filter [::String] - # Optional. Filter by solution type. For example: - # solution_type=SOLUTION_TYPE_SEARCH - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new - # - # # Call the list_engines method. - # result = client.list_engines request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. - # p item - # end - # - def list_engines request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_engines.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_engines.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_engines.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @engine_service_stub.list_engines request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @engine_service_stub, :list_engines, "engines", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EngineService REST API. - # - # This class represents the configuration for EngineService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_engine to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_engine.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_engine.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the EngineService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :create_engine - ## - # RPC-specific configuration for `delete_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_engine - ## - # RPC-specific configuration for `update_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :update_engine - ## - # RPC-specific configuration for `get_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :get_engine - ## - # RPC-specific configuration for `list_engines` - # @return [::Gapic::Config::Method] - # - attr_reader :list_engines - - # @private - def initialize parent_rpcs = nil - create_engine_config = parent_rpcs.create_engine if parent_rpcs.respond_to? :create_engine - @create_engine = ::Gapic::Config::Method.new create_engine_config - delete_engine_config = parent_rpcs.delete_engine if parent_rpcs.respond_to? :delete_engine - @delete_engine = ::Gapic::Config::Method.new delete_engine_config - update_engine_config = parent_rpcs.update_engine if parent_rpcs.respond_to? :update_engine - @update_engine = ::Gapic::Config::Method.new update_engine_config - get_engine_config = parent_rpcs.get_engine if parent_rpcs.respond_to? :get_engine - @get_engine = ::Gapic::Config::Method.new get_engine_config - list_engines_config = parent_rpcs.list_engines if parent_rpcs.respond_to? :list_engines - @list_engines = ::Gapic::Config::Method.new list_engines_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb deleted file mode 100644 index 71f04a56fcb8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EngineService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the EngineService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb deleted file mode 100644 index 6f8d0ae88050..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/engine_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - module Rest - ## - # REST service stub for the EngineService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_engine request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_engine_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_engine", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_engine request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_engine_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_engine", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # A result object deserialized from the server's reply - def update_engine request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_engine_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_engine", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Engine.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Engine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # A result object deserialized from the server's reply - def get_engine request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_engine_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_engine", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Engine.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_engines REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse] - # A result object deserialized from the server's reply - def list_engines request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_engines_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_engines", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_engine_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/engines", - body: "engine", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_engine_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_engine_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{engine.name}", - body: "engine", - matches: [ - ["engine.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_engine_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_engines REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_engines_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/engines", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb deleted file mode 100644 index e39e8142d53e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/grounded_generation_service/credentials" -require "google/cloud/discovery_engine/v1/grounded_generation_service/paths" -require "google/cloud/discovery_engine/v1/grounded_generation_service/client" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for grounded generation. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/grounded_generation_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new - # - module GroundedGenerationService - end - end - end - end -end - -helper_path = ::File.join __dir__, "grounded_generation_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/grounded_generation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb deleted file mode 100644 index a221ab67901c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +++ /dev/null @@ -1,733 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - ## - # Client for the GroundedGenerationService service. - # - # Service for grounded generation. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :grounded_generation_service_stub - - ## - # Configure the GroundedGenerationService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GroundedGenerationService clients - # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GroundedGenerationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @grounded_generation_service_stub.universe_domain - end - - ## - # Create a new GroundedGenerationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GroundedGenerationService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/grounded_generation_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @grounded_generation_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @grounded_generation_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @grounded_generation_service_stub.endpoint - config.universe_domain = @grounded_generation_service_stub.universe_domain - config.logger = @grounded_generation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @grounded_generation_service_stub.logger - end - - # Service calls - - ## - # Generates grounded content in a streaming fashion. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash>] - # An enumerable of {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the stream_generate_grounded_content method to start streaming. - # output = client.stream_generate_grounded_content input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - # input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse - # output.each do |current_response| - # p current_response - # end - # - def stream_generate_grounded_content request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest - end - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.stream_generate_grounded_content.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.stream_generate_grounded_content.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stream_generate_grounded_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @grounded_generation_service_stub.call_rpc :stream_generate_grounded_content, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generates grounded content. - # - # @overload generate_grounded_content(request, options = nil) - # Pass arguments to `generate_grounded_content` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload generate_grounded_content(location: nil, system_instruction: nil, contents: nil, generation_spec: nil, grounding_spec: nil, user_labels: nil) - # Pass arguments to `generate_grounded_content` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param location [::String] - # Required. Location resource. - # - # Format: `projects/{project}/locations/{location}`. - # @param system_instruction [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash] - # Content of the system instruction for the current API. - # - # These instructions will take priority over any other prompt instructions - # if the selected model is supporting them. - # @param contents [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash>] - # Content of the current conversation with the model. - # - # For single-turn queries, this is a single instance. For multi-turn queries, - # this is a repeated field that contains conversation history + latest - # request. - # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec, ::Hash] - # Content generation specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec, ::Hash] - # Grounding specification. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - # - # # Call the generate_grounded_content method. - # result = client.generate_grounded_content request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. - # p result - # - def generate_grounded_content request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.generate_grounded_content.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.location - header_params["location"] = request.location - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.generate_grounded_content.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_grounded_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @grounded_generation_service_stub.call_rpc :generate_grounded_content, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs a grounding check. - # - # @overload check_grounding(request, options = nil) - # Pass arguments to `check_grounding` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload check_grounding(grounding_config: nil, answer_candidate: nil, facts: nil, grounding_spec: nil, user_labels: nil) - # Pass arguments to `check_grounding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param grounding_config [::String] - # Required. The resource name of the grounding config, such as - # `projects/*/locations/global/groundingConfigs/default_grounding_config`. - # @param answer_candidate [::String] - # Answer candidate to check. It can have a maximum length of 4096 tokens. - # @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact, ::Hash>] - # List of facts for the grounding check. - # We support up to 200 facts. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec, ::Hash] - # Configuration of the grounding check. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new - # - # # Call the check_grounding method. - # result = client.check_grounding request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. - # p result - # - def check_grounding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.check_grounding.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.grounding_config - header_params["grounding_config"] = request.grounding_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.check_grounding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.check_grounding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @grounded_generation_service_stub.call_rpc :check_grounding, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the GroundedGenerationService API. - # - # This class represents the configuration for GroundedGenerationService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # stream_generate_grounded_content to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.stream_generate_grounded_content.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.stream_generate_grounded_content.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the GroundedGenerationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `stream_generate_grounded_content` - # @return [::Gapic::Config::Method] - # - attr_reader :stream_generate_grounded_content - ## - # RPC-specific configuration for `generate_grounded_content` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_grounded_content - ## - # RPC-specific configuration for `check_grounding` - # @return [::Gapic::Config::Method] - # - attr_reader :check_grounding - - # @private - def initialize parent_rpcs = nil - stream_generate_grounded_content_config = parent_rpcs.stream_generate_grounded_content if parent_rpcs.respond_to? :stream_generate_grounded_content - @stream_generate_grounded_content = ::Gapic::Config::Method.new stream_generate_grounded_content_config - generate_grounded_content_config = parent_rpcs.generate_grounded_content if parent_rpcs.respond_to? :generate_grounded_content - @generate_grounded_content = ::Gapic::Config::Method.new generate_grounded_content_config - check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding - @check_grounding = ::Gapic::Config::Method.new check_grounding_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb deleted file mode 100644 index ce9010344e1c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - # Credentials for the GroundedGenerationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb deleted file mode 100644 index 41e9852c971e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - # Path helper methods for the GroundedGenerationService API. - module Paths - ## - # Create a fully-qualified GroundingConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/groundingConfigs/{grounding_config}` - # - # @param project [String] - # @param location [String] - # @param grounding_config [String] - # - # @return [::String] - def grounding_config_path project:, location:, grounding_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/groundingConfigs/#{grounding_config}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified ServingConfig resource string. - # - # @overload serving_config_path(project:, location:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path **args - resources = { - "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb deleted file mode 100644 index d27abf7a0f61..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/grounded_generation_service/credentials" -require "google/cloud/discovery_engine/v1/grounded_generation_service/paths" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for grounded generation. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new - # - module GroundedGenerationService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb deleted file mode 100644 index e2615ece6759..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +++ /dev/null @@ -1,591 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - module Rest - ## - # REST client for the GroundedGenerationService service. - # - # Service for grounded generation. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :grounded_generation_service_stub - - ## - # Configure the GroundedGenerationService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GroundedGenerationService clients - # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GroundedGenerationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @grounded_generation_service_stub.universe_domain - end - - ## - # Create a new GroundedGenerationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GroundedGenerationService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @grounded_generation_service_stub = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @grounded_generation_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @grounded_generation_service_stub.endpoint - config.universe_domain = @grounded_generation_service_stub.universe_domain - config.logger = @grounded_generation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @grounded_generation_service_stub.logger - end - - # Service calls - - ## - # Generates grounded content. - # - # @overload generate_grounded_content(request, options = nil) - # Pass arguments to `generate_grounded_content` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload generate_grounded_content(location: nil, system_instruction: nil, contents: nil, generation_spec: nil, grounding_spec: nil, user_labels: nil) - # Pass arguments to `generate_grounded_content` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param location [::String] - # Required. Location resource. - # - # Format: `projects/{project}/locations/{location}`. - # @param system_instruction [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash] - # Content of the system instruction for the current API. - # - # These instructions will take priority over any other prompt instructions - # if the selected model is supporting them. - # @param contents [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, ::Hash>] - # Content of the current conversation with the model. - # - # For single-turn queries, this is a single instance. For multi-turn queries, - # this is a repeated field that contains conversation history + latest - # request. - # @param generation_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec, ::Hash] - # Content generation specification. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec, ::Hash] - # Grounding specification. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - # - # # Call the generate_grounded_content method. - # result = client.generate_grounded_content request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. - # p result - # - def generate_grounded_content request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.generate_grounded_content.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.generate_grounded_content.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_grounded_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @grounded_generation_service_stub.generate_grounded_content request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs a grounding check. - # - # @overload check_grounding(request, options = nil) - # Pass arguments to `check_grounding` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload check_grounding(grounding_config: nil, answer_candidate: nil, facts: nil, grounding_spec: nil, user_labels: nil) - # Pass arguments to `check_grounding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param grounding_config [::String] - # Required. The resource name of the grounding config, such as - # `projects/*/locations/global/groundingConfigs/default_grounding_config`. - # @param answer_candidate [::String] - # Answer candidate to check. It can have a maximum length of 4096 tokens. - # @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact, ::Hash>] - # List of facts for the grounding check. - # We support up to 200 facts. - # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec, ::Hash] - # Configuration of the grounding check. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new - # - # # Call the check_grounding method. - # result = client.check_grounding request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. - # p result - # - def check_grounding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.check_grounding.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.check_grounding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.check_grounding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @grounded_generation_service_stub.check_grounding request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the GroundedGenerationService REST API. - # - # This class represents the configuration for GroundedGenerationService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # generate_grounded_content to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.generate_grounded_content.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.generate_grounded_content.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the GroundedGenerationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `generate_grounded_content` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_grounded_content - ## - # RPC-specific configuration for `check_grounding` - # @return [::Gapic::Config::Method] - # - attr_reader :check_grounding - - # @private - def initialize parent_rpcs = nil - generate_grounded_content_config = parent_rpcs.generate_grounded_content if parent_rpcs.respond_to? :generate_grounded_content - @generate_grounded_content = ::Gapic::Config::Method.new generate_grounded_content_config - check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding - @check_grounding = ::Gapic::Config::Method.new check_grounding_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb deleted file mode 100644 index 9f8f6c3b7a7e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - module Rest - ## - # REST service stub for the GroundedGenerationService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the generate_grounded_content REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse] - # A result object deserialized from the server's reply - def generate_grounded_content request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_grounded_content_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "generate_grounded_content", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the check_grounding REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse] - # A result object deserialized from the server's reply - def check_grounding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_check_grounding_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "check_grounding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_grounded_content REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_generate_grounded_content_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{location}:generateGroundedContent", - body: "*", - matches: [ - ["location", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the check_grounding REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_check_grounding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{grounding_config}:check", - body: "*", - matches: [ - ["grounding_config", %r{^projects/[^/]+/locations/[^/]+/groundingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb deleted file mode 100644 index 758f8fea5e26..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/paths" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/operations" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/client" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Identity Mapping Stores. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/identity_mapping_store_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - module IdentityMappingStoreService - end - end - end - end -end - -helper_path = ::File.join __dir__, "identity_mapping_store_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb deleted file mode 100644 index a125b98068fb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb +++ /dev/null @@ -1,1177 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - ## - # Client for the IdentityMappingStoreService service. - # - # Service for managing Identity Mapping Stores. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :identity_mapping_store_service_stub - - ## - # Configure the IdentityMappingStoreService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IdentityMappingStoreService clients - # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IdentityMappingStoreService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @identity_mapping_store_service_stub.universe_domain - end - - ## - # Create a new IdentityMappingStoreService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IdentityMappingStoreService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @identity_mapping_store_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @identity_mapping_store_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @identity_mapping_store_service_stub.endpoint - config.universe_domain = @identity_mapping_store_service_stub.universe_domain - config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @identity_mapping_store_service_stub.logger - end - - # Service calls - - ## - # Creates a new Identity Mapping Store. - # - # @overload create_identity_mapping_store(request, options = nil) - # Pass arguments to `create_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil) - # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cmek_config_name [::String] - # Resource name of the CmekConfig to use for protecting this Identity - # Mapping Store. - # - # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param disable_cmek [::Boolean] - # Identity Mapping Store without CMEK protections. If a default CmekConfig - # is set for the project, setting this field will override the default - # CmekConfig as well. - # - # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent collection resource name, such as - # `projects/{project}/locations/{location}`. - # @param identity_mapping_store_id [::String] - # Required. The ID of the Identity Mapping Store to create. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - # (_), and hyphens (-). The maximum length is 63 characters. - # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash] - # Required. The Identity Mapping Store to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new - # - # # Call the create_identity_mapping_store method. - # result = client.create_identity_mapping_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p result - # - def create_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :create_identity_mapping_store, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the Identity Mapping Store. - # - # @overload get_identity_mapping_store(request, options = nil) - # Pass arguments to `get_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_identity_mapping_store(name: nil) - # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the Identity Mapping Store to get. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new - # - # # Call the get_identity_mapping_store method. - # result = client.get_identity_mapping_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p result - # - def get_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :get_identity_mapping_store, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the Identity Mapping Store. - # - # @overload delete_identity_mapping_store(request, options = nil) - # Pass arguments to `delete_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_identity_mapping_store(name: nil) - # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the Identity Mapping Store to delete. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new - # - # # Call the delete_identity_mapping_store method. - # result = client.delete_identity_mapping_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :delete_identity_mapping_store, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports a list of Identity Mapping Entries to an Identity Mapping Store. - # - # @overload import_identity_mappings(request, options = nil) - # Pass arguments to `import_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil) - # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash] - # The inline source to import identity mapping entries from. - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to import Identity Mapping - # Entries to. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new - # - # # Call the import_identity_mappings method. - # result = client.import_identity_mappings request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.identity_mapping_store - header_params["identity_mapping_store"] = request.identity_mapping_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :import_identity_mappings, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges specified or all Identity Mapping Entries from an Identity Mapping - # Store. - # - # @overload purge_identity_mappings(request, options = nil) - # Pass arguments to `purge_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil) - # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash] - # The inline source to purge identity mapping entries from. - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to purge Identity Mapping - # Entries from. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @param filter [::String] - # Filter matching identity mappings to purge. - # The eligible field for filtering is: - # * `update_time`: in ISO 8601 "zulu" format. - # * `external_id` - # - # Examples: - # - # * Deleting all identity mappings updated in a time range: - # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < - # "2012-04-23T18:30:43.511Z"` - # * Deleting all identity mappings for a given external_id: - # `external_id = "id1"` - # * Deleting all identity mappings inside an identity mapping store: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # Should not be used with source. An error will be thrown, if both are - # provided. - # @param force [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any identity mappings. This field is - # only supported for purge with filter. For input source this field is - # ignored and data will be purged regardless of the value of this field. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new - # - # # Call the purge_identity_mappings method. - # result = client.purge_identity_mappings request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.purge_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.identity_mapping_store - header_params["identity_mapping_store"] = request.identity_mapping_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :purge_identity_mappings, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists Identity Mappings in an Identity Mapping Store. - # - # @overload list_identity_mappings(request, options = nil) - # Pass arguments to `list_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to list Identity Mapping - # Entries in. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @param page_size [::Integer] - # Maximum number of IdentityMappings to return. If unspecified, defaults - # to 2000. The maximum allowed value is 10000. Values above 10000 will be - # coerced to 10000. - # @param page_token [::String] - # A page token, received from a previous `ListIdentityMappings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappings` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new - # - # # Call the list_identity_mappings method. - # result = client.list_identity_mappings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. - # p item - # end - # - def list_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.identity_mapping_store - header_params["identity_mapping_store"] = request.identity_mapping_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :list_identity_mappings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Identity Mapping Stores. - # - # @overload list_identity_mapping_stores(request, options = nil) - # Pass arguments to `list_identity_mapping_stores` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent of the Identity Mapping Stores to list. - # Format: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Maximum number of IdentityMappingStores to return. If unspecified, defaults - # to 100. The maximum allowed value is 1000. Values above 1000 will be - # coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListIdentityMappingStores` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappingStores` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new - # - # # Call the list_identity_mapping_stores method. - # result = client.list_identity_mapping_stores request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p item - # end - # - def list_identity_mapping_stores request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.call_rpc :list_identity_mapping_stores, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the IdentityMappingStoreService API. - # - # This class represents the configuration for IdentityMappingStoreService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_identity_mapping_store to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_identity_mapping_store.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_identity_mapping_store.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the IdentityMappingStoreService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :create_identity_mapping_store - ## - # RPC-specific configuration for `get_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :get_identity_mapping_store - ## - # RPC-specific configuration for `delete_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_identity_mapping_store - ## - # RPC-specific configuration for `import_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :import_identity_mappings - ## - # RPC-specific configuration for `purge_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_identity_mappings - ## - # RPC-specific configuration for `list_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_identity_mappings - ## - # RPC-specific configuration for `list_identity_mapping_stores` - # @return [::Gapic::Config::Method] - # - attr_reader :list_identity_mapping_stores - - # @private - def initialize parent_rpcs = nil - create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store - @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config - get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store - @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config - delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store - @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config - import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings - @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config - purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings - @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config - list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings - @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config - list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores - @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb deleted file mode 100644 index 96ab6e178be7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - # Credentials for the IdentityMappingStoreService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb deleted file mode 100644 index 99f4cfcfa0c0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the IdentityMappingStoreService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the IdentityMappingStoreService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb deleted file mode 100644 index 17ad1ea56488..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - # Path helper methods for the IdentityMappingStoreService API. - module Paths - ## - # Create a fully-qualified CmekConfig resource string. - # - # @overload cmek_config_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfig` - # - # @param project [String] - # @param location [String] - # - # @overload cmek_config_path(project:, location:, cmek_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}` - # - # @param project [String] - # @param location [String] - # @param cmek_config [String] - # - # @return [::String] - def cmek_config_path **args - resources = { - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfig" - end), - "cmek_config:location:project" => (proc do |project:, location:, cmek_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified CryptoKeyVersions resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified CryptoKeys resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_keys_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified IdentityMappingStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}` - # - # @param project [String] - # @param location [String] - # @param identity_mapping_store [String] - # - # @return [::String] - def identity_mapping_store_path project:, location:, identity_mapping_store: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/identityMappingStores/#{identity_mapping_store}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb deleted file mode 100644 index e4278ea8733b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/paths" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Identity Mapping Stores. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - module IdentityMappingStoreService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb deleted file mode 100644 index 6efcf137c7fe..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb +++ /dev/null @@ -1,1085 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - module Rest - ## - # REST client for the IdentityMappingStoreService service. - # - # Service for managing Identity Mapping Stores. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :identity_mapping_store_service_stub - - ## - # Configure the IdentityMappingStoreService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IdentityMappingStoreService clients - # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IdentityMappingStoreService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @identity_mapping_store_service_stub.universe_domain - end - - ## - # Create a new IdentityMappingStoreService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IdentityMappingStoreService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @identity_mapping_store_service_stub = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @identity_mapping_store_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @identity_mapping_store_service_stub.endpoint - config.universe_domain = @identity_mapping_store_service_stub.universe_domain - config.logger = @identity_mapping_store_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @identity_mapping_store_service_stub.logger - end - - # Service calls - - ## - # Creates a new Identity Mapping Store. - # - # @overload create_identity_mapping_store(request, options = nil) - # Pass arguments to `create_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_identity_mapping_store(cmek_config_name: nil, disable_cmek: nil, parent: nil, identity_mapping_store_id: nil, identity_mapping_store: nil) - # Pass arguments to `create_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cmek_config_name [::String] - # Resource name of the CmekConfig to use for protecting this Identity - # Mapping Store. - # - # Note: The following parameters are mutually exclusive: `cmek_config_name`, `disable_cmek`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param disable_cmek [::Boolean] - # Identity Mapping Store without CMEK protections. If a default CmekConfig - # is set for the project, setting this field will override the default - # CmekConfig as well. - # - # Note: The following parameters are mutually exclusive: `disable_cmek`, `cmek_config_name`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. The parent collection resource name, such as - # `projects/{project}/locations/{location}`. - # @param identity_mapping_store_id [::String] - # Required. The ID of the Identity Mapping Store to create. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - # (_), and hyphens (-). The maximum length is 63 characters. - # @param identity_mapping_store [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore, ::Hash] - # Required. The Identity Mapping Store to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new - # - # # Call the create_identity_mapping_store method. - # result = client.create_identity_mapping_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p result - # - def create_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_identity_mapping_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.create_identity_mapping_store request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the Identity Mapping Store. - # - # @overload get_identity_mapping_store(request, options = nil) - # Pass arguments to `get_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_identity_mapping_store(name: nil) - # Pass arguments to `get_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the Identity Mapping Store to get. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new - # - # # Call the get_identity_mapping_store method. - # result = client.get_identity_mapping_store request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p result - # - def get_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_identity_mapping_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.get_identity_mapping_store request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the Identity Mapping Store. - # - # @overload delete_identity_mapping_store(request, options = nil) - # Pass arguments to `delete_identity_mapping_store` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_identity_mapping_store(name: nil) - # Pass arguments to `delete_identity_mapping_store` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the Identity Mapping Store to delete. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new - # - # # Call the delete_identity_mapping_store method. - # result = client.delete_identity_mapping_store request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_identity_mapping_store request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_identity_mapping_store.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_identity_mapping_store.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_identity_mapping_store.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.delete_identity_mapping_store request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports a list of Identity Mapping Entries to an Identity Mapping Store. - # - # @overload import_identity_mappings(request, options = nil) - # Pass arguments to `import_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_identity_mappings(inline_source: nil, identity_mapping_store: nil) - # Pass arguments to `import_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource, ::Hash] - # The inline source to import identity mapping entries from. - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to import Identity Mapping - # Entries to. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new - # - # # Call the import_identity_mappings method. - # result = client.import_identity_mappings request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_identity_mappings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.import_identity_mappings request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges specified or all Identity Mapping Entries from an Identity Mapping - # Store. - # - # @overload purge_identity_mappings(request, options = nil) - # Pass arguments to `purge_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_identity_mappings(inline_source: nil, identity_mapping_store: nil, filter: nil, force: nil) - # Pass arguments to `purge_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource, ::Hash] - # The inline source to purge identity mapping entries from. - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to purge Identity Mapping - # Entries from. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @param filter [::String] - # Filter matching identity mappings to purge. - # The eligible field for filtering is: - # * `update_time`: in ISO 8601 "zulu" format. - # * `external_id` - # - # Examples: - # - # * Deleting all identity mappings updated in a time range: - # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < - # "2012-04-23T18:30:43.511Z"` - # * Deleting all identity mappings for a given external_id: - # `external_id = "id1"` - # * Deleting all identity mappings inside an identity mapping store: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # Should not be used with source. An error will be thrown, if both are - # provided. - # @param force [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any identity mappings. This field is - # only supported for purge with filter. For input source this field is - # ignored and data will be purged regardless of the value of this field. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new - # - # # Call the purge_identity_mappings method. - # result = client.purge_identity_mappings request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.purge_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_identity_mappings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.purge_identity_mappings request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists Identity Mappings in an Identity Mapping Store. - # - # @overload list_identity_mappings(request, options = nil) - # Pass arguments to `list_identity_mappings` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_identity_mappings(identity_mapping_store: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_identity_mappings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param identity_mapping_store [::String] - # Required. The name of the Identity Mapping Store to list Identity Mapping - # Entries in. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @param page_size [::Integer] - # Maximum number of IdentityMappings to return. If unspecified, defaults - # to 2000. The maximum allowed value is 10000. Values above 10000 will be - # coerced to 10000. - # @param page_token [::String] - # A page token, received from a previous `ListIdentityMappings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappings` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new - # - # # Call the list_identity_mappings method. - # result = client.list_identity_mappings request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. - # p item - # end - # - def list_identity_mappings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_identity_mappings.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_identity_mappings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_identity_mappings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.list_identity_mappings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mappings, "identity_mapping_entries", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Identity Mapping Stores. - # - # @overload list_identity_mapping_stores(request, options = nil) - # Pass arguments to `list_identity_mapping_stores` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_identity_mapping_stores(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_identity_mapping_stores` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent of the Identity Mapping Stores to list. - # Format: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Maximum number of IdentityMappingStores to return. If unspecified, defaults - # to 100. The maximum allowed value is 1000. Values above 1000 will be - # coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListIdentityMappingStores` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappingStores` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new - # - # # Call the list_identity_mapping_stores method. - # result = client.list_identity_mapping_stores request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - # p item - # end - # - def list_identity_mapping_stores request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_identity_mapping_stores.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_identity_mapping_stores.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_identity_mapping_stores.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @identity_mapping_store_service_stub.list_identity_mapping_stores request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @identity_mapping_store_service_stub, :list_identity_mapping_stores, "identity_mapping_stores", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the IdentityMappingStoreService REST API. - # - # This class represents the configuration for IdentityMappingStoreService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_identity_mapping_store to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_identity_mapping_store.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_identity_mapping_store.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the IdentityMappingStoreService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :create_identity_mapping_store - ## - # RPC-specific configuration for `get_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :get_identity_mapping_store - ## - # RPC-specific configuration for `delete_identity_mapping_store` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_identity_mapping_store - ## - # RPC-specific configuration for `import_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :import_identity_mappings - ## - # RPC-specific configuration for `purge_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_identity_mappings - ## - # RPC-specific configuration for `list_identity_mappings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_identity_mappings - ## - # RPC-specific configuration for `list_identity_mapping_stores` - # @return [::Gapic::Config::Method] - # - attr_reader :list_identity_mapping_stores - - # @private - def initialize parent_rpcs = nil - create_identity_mapping_store_config = parent_rpcs.create_identity_mapping_store if parent_rpcs.respond_to? :create_identity_mapping_store - @create_identity_mapping_store = ::Gapic::Config::Method.new create_identity_mapping_store_config - get_identity_mapping_store_config = parent_rpcs.get_identity_mapping_store if parent_rpcs.respond_to? :get_identity_mapping_store - @get_identity_mapping_store = ::Gapic::Config::Method.new get_identity_mapping_store_config - delete_identity_mapping_store_config = parent_rpcs.delete_identity_mapping_store if parent_rpcs.respond_to? :delete_identity_mapping_store - @delete_identity_mapping_store = ::Gapic::Config::Method.new delete_identity_mapping_store_config - import_identity_mappings_config = parent_rpcs.import_identity_mappings if parent_rpcs.respond_to? :import_identity_mappings - @import_identity_mappings = ::Gapic::Config::Method.new import_identity_mappings_config - purge_identity_mappings_config = parent_rpcs.purge_identity_mappings if parent_rpcs.respond_to? :purge_identity_mappings - @purge_identity_mappings = ::Gapic::Config::Method.new purge_identity_mappings_config - list_identity_mappings_config = parent_rpcs.list_identity_mappings if parent_rpcs.respond_to? :list_identity_mappings - @list_identity_mappings = ::Gapic::Config::Method.new list_identity_mappings_config - list_identity_mapping_stores_config = parent_rpcs.list_identity_mapping_stores if parent_rpcs.respond_to? :list_identity_mapping_stores - @list_identity_mapping_stores = ::Gapic::Config::Method.new list_identity_mapping_stores_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb deleted file mode 100644 index 25e058f04d93..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the IdentityMappingStoreService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the IdentityMappingStoreService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb deleted file mode 100644 index 4122c1d96cbc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb +++ /dev/null @@ -1,511 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - module Rest - ## - # REST service stub for the IdentityMappingStoreService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # A result object deserialized from the server's reply - def create_identity_mapping_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_identity_mapping_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_identity_mapping_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # A result object deserialized from the server's reply - def get_identity_mapping_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_identity_mapping_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_identity_mapping_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_identity_mapping_store request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_identity_mapping_store_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_identity_mapping_store", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_identity_mappings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_identity_mappings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_identity_mappings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def purge_identity_mappings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_identity_mappings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "purge_identity_mappings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse] - # A result object deserialized from the server's reply - def list_identity_mappings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_identity_mappings_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_identity_mappings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_identity_mapping_stores REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse] - # A result object deserialized from the server's reply - def list_identity_mapping_stores request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_identity_mapping_stores_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_identity_mapping_stores", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_identity_mapping_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/identityMappingStores", - body: "identity_mapping_store", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_identity_mapping_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_identity_mapping_store REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_identity_mapping_store_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_identity_mappings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{identity_mapping_store}:importIdentityMappings", - body: "*", - matches: [ - ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_identity_mappings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{identity_mapping_store}:purgeIdentityMappings", - body: "*", - matches: [ - ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_identity_mappings REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_identity_mappings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{identity_mapping_store}:listIdentityMappings", - matches: [ - ["identity_mapping_store", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_identity_mapping_stores REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_identity_mapping_stores_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/identityMappingStores", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb deleted file mode 100644 index 7be3f306beb0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/project_service/credentials" -require "google/cloud/discovery_engine/v1/project_service/paths" -require "google/cloud/discovery_engine/v1/project_service/operations" -require "google/cloud/discovery_engine/v1/project_service/client" -require "google/cloud/discovery_engine/v1/project_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for operations on the - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/project_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/project_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new - # - module ProjectService - end - end - end - end -end - -helper_path = ::File.join __dir__, "project_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/project_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb deleted file mode 100644 index 6d193af7d00c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/client.rb +++ /dev/null @@ -1,536 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/project_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - ## - # Client for the ProjectService service. - # - # Service for operations on the - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :project_service_stub - - ## - # Configure the ProjectService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProjectService clients - # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProjectService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @project_service_stub.universe_domain - end - - ## - # Create a new ProjectService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProjectService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/project_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @project_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @project_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @project_service_stub.endpoint - config.universe_domain = @project_service_stub.universe_domain - config.logger = @project_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @project_service_stub.logger - end - - # Service calls - - ## - # Provisions the project resource. During the - # process, related systems will get prepared and initialized. - # - # Caller must read the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms), and optionally - # specify in request to provide consent to that service terms. - # - # @overload provision_project(request, options = nil) - # Pass arguments to `provision_project` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload provision_project(name: nil, accept_data_use_terms: nil, data_use_terms_version: nil) - # Pass arguments to `provision_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as - # `projects/{project_id_or_number}`. - # @param accept_data_use_terms [::Boolean] - # Required. Set to `true` to specify that caller has read and would like to - # give consent to the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms). - # @param data_use_terms_version [::String] - # Required. The version of the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms) that caller has read - # and would like to give consent to. - # - # Acceptable version is `2022-11-23`, and this may change over time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new - # - # # Call the provision_project method. - # result = client.provision_project request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def provision_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.provision_project.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.provision_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.provision_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @project_service_stub.call_rpc :provision_project, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ProjectService API. - # - # This class represents the configuration for ProjectService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # provision_project to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.provision_project.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.provision_project.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ProjectService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `provision_project` - # @return [::Gapic::Config::Method] - # - attr_reader :provision_project - - # @private - def initialize parent_rpcs = nil - provision_project_config = parent_rpcs.provision_project if parent_rpcs.respond_to? :provision_project - @provision_project = ::Gapic::Config::Method.new provision_project_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb deleted file mode 100644 index 56221ceb0943..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - # Credentials for the ProjectService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb deleted file mode 100644 index 1ca54e3470f3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProjectService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the ProjectService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb deleted file mode 100644 index b8da2cb8502d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/paths.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - # Path helper methods for the ProjectService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb deleted file mode 100644 index a3427490520d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/project_service/credentials" -require "google/cloud/discovery_engine/v1/project_service/paths" -require "google/cloud/discovery_engine/v1/project_service/rest/operations" -require "google/cloud/discovery_engine/v1/project_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for operations on the - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/project_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new - # - module ProjectService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/project_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb deleted file mode 100644 index 2a2b0ce19473..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +++ /dev/null @@ -1,486 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/project_service_pb" -require "google/cloud/discovery_engine/v1/project_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - module Rest - ## - # REST client for the ProjectService service. - # - # Service for operations on the - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :project_service_stub - - ## - # Configure the ProjectService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProjectService clients - # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProjectService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @project_service_stub.universe_domain - end - - ## - # Create a new ProjectService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProjectService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @project_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @project_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @project_service_stub.endpoint - config.universe_domain = @project_service_stub.universe_domain - config.logger = @project_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @project_service_stub.logger - end - - # Service calls - - ## - # Provisions the project resource. During the - # process, related systems will get prepared and initialized. - # - # Caller must read the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms), and optionally - # specify in request to provide consent to that service terms. - # - # @overload provision_project(request, options = nil) - # Pass arguments to `provision_project` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload provision_project(name: nil, accept_data_use_terms: nil, data_use_terms_version: nil) - # Pass arguments to `provision_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as - # `projects/{project_id_or_number}`. - # @param accept_data_use_terms [::Boolean] - # Required. Set to `true` to specify that caller has read and would like to - # give consent to the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms). - # @param data_use_terms_version [::String] - # Required. The version of the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms) that caller has read - # and would like to give consent to. - # - # Acceptable version is `2022-11-23`, and this may change over time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new - # - # # Call the provision_project method. - # result = client.provision_project request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def provision_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.provision_project.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.provision_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.provision_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @project_service_stub.provision_project request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ProjectService REST API. - # - # This class represents the configuration for ProjectService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # provision_project to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.provision_project.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.provision_project.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ProjectService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `provision_project` - # @return [::Gapic::Config::Method] - # - attr_reader :provision_project - - # @private - def initialize parent_rpcs = nil - provision_project_config = parent_rpcs.provision_project if parent_rpcs.respond_to? :provision_project - @provision_project = ::Gapic::Config::Method.new provision_project_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb deleted file mode 100644 index a104f592a062..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProjectService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the ProjectService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb deleted file mode 100644 index 3810371e874d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/project_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - module Rest - ## - # REST service stub for the ProjectService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the provision_project REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def provision_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_provision_project_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "provision_project", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the provision_project REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_provision_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:provision", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb deleted file mode 100644 index 001d9b54d2df..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/rank_service/credentials" -require "google/cloud/discovery_engine/v1/rank_service/paths" -require "google/cloud/discovery_engine/v1/rank_service/client" -require "google/cloud/discovery_engine/v1/rank_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ranking text records. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/rank_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/rank_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new - # - module RankService - end - end - end - end -end - -helper_path = ::File.join __dir__, "rank_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/rank_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb deleted file mode 100644 index c7e3d2b80483..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +++ /dev/null @@ -1,531 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/rank_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - ## - # Client for the RankService service. - # - # Service for ranking text records. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :rank_service_stub - - ## - # Configure the RankService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RankService clients - # ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RankService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @rank_service_stub.universe_domain - end - - ## - # Create a new RankService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RankService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/rank_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @rank_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::RankService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @rank_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @rank_service_stub.endpoint - config.universe_domain = @rank_service_stub.universe_domain - config.logger = @rank_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @rank_service_stub.logger - end - - # Service calls - - ## - # Ranks a list of text records based on the given input query. - # - # @overload rank(request, options = nil) - # Pass arguments to `rank` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RankRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil) - # Pass arguments to `rank` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ranking_config [::String] - # Required. The resource name of the rank service config, such as - # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. - # @param model [::String] - # The identifier of the model to use. It is one of: - # - # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input - # token size 512. - # - # It is set to `semantic-ranker-512@latest` by default if unspecified. - # @param top_n [::Integer] - # The number of results to return. If this is unset or no bigger than zero, - # returns all results. - # @param query [::String] - # The query to use. - # @param records [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord, ::Hash>] - # Required. A list of records to rank. At most 200 records to rank. - # @param ignore_record_details_in_response [::Boolean] - # If true, the response will contain only record ID and score. By default, it - # is false, the response will contain record details. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::RankService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new - # - # # Call the rank method. - # result = client.rank request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. - # p result - # - def rank request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RankRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.rank.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.ranking_config - header_params["ranking_config"] = request.ranking_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rank.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rank.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rank_service_stub.call_rpc :rank, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RankService API. - # - # This class represents the configuration for RankService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # rank to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.rank.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.rank.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the RankService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `rank` - # @return [::Gapic::Config::Method] - # - attr_reader :rank - - # @private - def initialize parent_rpcs = nil - rank_config = parent_rpcs.rank if parent_rpcs.respond_to? :rank - @rank = ::Gapic::Config::Method.new rank_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb deleted file mode 100644 index aa1cf428231a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - # Credentials for the RankService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb deleted file mode 100644 index 3572501fb9b7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - # Path helper methods for the RankService API. - module Paths - ## - # Create a fully-qualified RankingConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/rankingConfigs/{ranking_config}` - # - # @param project [String] - # @param location [String] - # @param ranking_config [String] - # - # @return [::String] - def ranking_config_path project:, location:, ranking_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/rankingConfigs/#{ranking_config}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb deleted file mode 100644 index cbd7c266f04c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/rank_service/credentials" -require "google/cloud/discovery_engine/v1/rank_service/paths" -require "google/cloud/discovery_engine/v1/rank_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ranking text records. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/rank_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new - # - module RankService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/rank_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb deleted file mode 100644 index 7eedeb32e946..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +++ /dev/null @@ -1,481 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/rank_service_pb" -require "google/cloud/discovery_engine/v1/rank_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - module Rest - ## - # REST client for the RankService service. - # - # Service for ranking text records. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :rank_service_stub - - ## - # Configure the RankService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RankService clients - # ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RankService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @rank_service_stub.universe_domain - end - - ## - # Create a new RankService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RankService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @rank_service_stub = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @rank_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @rank_service_stub.endpoint - config.universe_domain = @rank_service_stub.universe_domain - config.logger = @rank_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @rank_service_stub.logger - end - - # Service calls - - ## - # Ranks a list of text records based on the given input query. - # - # @overload rank(request, options = nil) - # Pass arguments to `rank` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RankRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil) - # Pass arguments to `rank` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param ranking_config [::String] - # Required. The resource name of the rank service config, such as - # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. - # @param model [::String] - # The identifier of the model to use. It is one of: - # - # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input - # token size 512. - # - # It is set to `semantic-ranker-512@latest` by default if unspecified. - # @param top_n [::Integer] - # The number of results to return. If this is unset or no bigger than zero, - # returns all results. - # @param query [::String] - # The query to use. - # @param records [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord, ::Hash>] - # Required. A list of records to rank. At most 200 records to rank. - # @param ignore_record_details_in_response [::Boolean] - # If true, the response will contain only record ID and score. By default, it - # is false, the response will contain record details. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new - # - # # Call the rank method. - # result = client.rank request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. - # p result - # - def rank request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RankRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.rank.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.rank.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.rank.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @rank_service_stub.rank request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RankService REST API. - # - # This class represents the configuration for RankService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # rank to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.rank.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.rank.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the RankService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `rank` - # @return [::Gapic::Config::Method] - # - attr_reader :rank - - # @private - def initialize parent_rpcs = nil - rank_config = parent_rpcs.rank if parent_rpcs.respond_to? :rank - @rank = ::Gapic::Config::Method.new rank_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb deleted file mode 100644 index 9219fbde7576..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/rank_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - module Rest - ## - # REST service stub for the RankService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the rank REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RankRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RankResponse] - # A result object deserialized from the server's reply - def rank request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_rank_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "rank", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the rank REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RankRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_rank_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{ranking_config}:rank", - body: "*", - matches: [ - ["ranking_config", %r{^projects/[^/]+/locations/[^/]+/rankingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb deleted file mode 100644 index 7fb8b2b8faf0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/recommendation_service/credentials" -require "google/cloud/discovery_engine/v1/recommendation_service/paths" -require "google/cloud/discovery_engine/v1/recommendation_service/client" -require "google/cloud/discovery_engine/v1/recommendation_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for making recommendations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/recommendation_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/recommendation_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new - # - module RecommendationService - end - end - end - end -end - -helper_path = ::File.join __dir__, "recommendation_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/recommendation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb deleted file mode 100644 index 50ba0d7ae98d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +++ /dev/null @@ -1,609 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/recommendation_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RecommendationService - ## - # Client for the RecommendationService service. - # - # Service for making recommendations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recommendation_service_stub - - ## - # Configure the RecommendationService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RecommendationService clients - # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RecommendationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @recommendation_service_stub.universe_domain - end - - ## - # Create a new RecommendationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RecommendationService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/recommendation_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @recommendation_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @recommendation_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @recommendation_service_stub.endpoint - config.universe_domain = @recommendation_service_stub.universe_domain - config.logger = @recommendation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @recommendation_service_stub.logger - end - - # Service calls - - ## - # Makes a recommendation, which requires a contextual user event. - # - # @overload recommend(request, options = nil) - # Pass arguments to `recommend` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recommend(serving_config: nil, user_event: nil, page_size: nil, filter: nil, validate_only: nil, params: nil, user_labels: nil) - # Pass arguments to `recommend` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: - # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or - # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` - # - # One default serving config is created along with your recommendation engine - # creation. The engine ID is used as the ID of the default serving - # config. For example, for Engine - # `projects/*/locations/global/collections/*/engines/my-engine`, you can use - # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` - # for your - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend} - # requests. - # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # or - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # to a random unique ID and leave - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} - # unset. - # @param page_size [::Integer] - # Maximum number of results to return. Set this property - # to the number of recommendation results needed. If zero, the service - # chooses a reasonable default. The maximum allowed value is 100. Values - # above 100 are set to 100. - # @param filter [::String] - # 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: - # - # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) - # * (available: true) AND - # (language: ANY("en", "es")) OR (categories: ANY("Movie")) - # - # If your filter blocks all results, the API returns generic - # (unfiltered) popular Documents. If you only want results strictly matching - # the filters, set `strictFiltering` to `true` in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} - # to receive empty results instead. - # - # Note that the API never returns - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` - # as `EXPIRED` or `DELETED` regardless of filter choices. - # @param validate_only [::Boolean] - # Use validate only mode for this recommendation query. If set to `true`, a - # fake model is 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. - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # Additional domain specific parameters for the recommendations. - # - # Allowed values: - # - # * `returnDocument`: Boolean. If set to `true`, the associated Document - # object is returned in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. - # * `returnScore`: Boolean. If set to true, the recommendation score - # corresponding to each returned Document is set in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 - # returns 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. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new - # - # # Call the recommend method. - # result = client.recommend request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. - # p result - # - def recommend request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.recommend.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.recommend.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recommend.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommendation_service_stub.call_rpc :recommend, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RecommendationService API. - # - # This class represents the configuration for RecommendationService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recommend to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recommend.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recommend.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the RecommendationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recommend` - # @return [::Gapic::Config::Method] - # - attr_reader :recommend - - # @private - def initialize parent_rpcs = nil - recommend_config = parent_rpcs.recommend if parent_rpcs.respond_to? :recommend - @recommend = ::Gapic::Config::Method.new recommend_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb deleted file mode 100644 index bb77b81ac23c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RecommendationService - # Credentials for the RecommendationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb deleted file mode 100644 index b0938c55ce09..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +++ /dev/null @@ -1,220 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RecommendationService - # Path helper methods for the RecommendationService API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Engine resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # - # @return [::String] - def engine_path project:, location:, collection:, engine: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" - end - - ## - # Create a fully-qualified ServingConfig resource string. - # - # @overload serving_config_path(project:, location:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path **args - resources = { - "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb deleted file mode 100644 index ef121eb8536a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/recommendation_service/credentials" -require "google/cloud/discovery_engine/v1/recommendation_service/paths" -require "google/cloud/discovery_engine/v1/recommendation_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for making recommendations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/recommendation_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new - # - module RecommendationService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/recommendation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb deleted file mode 100644 index af317913f3cd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +++ /dev/null @@ -1,559 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/recommendation_service_pb" -require "google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RecommendationService - module Rest - ## - # REST client for the RecommendationService service. - # - # Service for making recommendations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :recommendation_service_stub - - ## - # Configure the RecommendationService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all RecommendationService clients - # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 5.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 5.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the RecommendationService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @recommendation_service_stub.universe_domain - end - - ## - # Create a new RecommendationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the RecommendationService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @recommendation_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @recommendation_service_stub.endpoint - config.universe_domain = @recommendation_service_stub.universe_domain - config.logger = @recommendation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @recommendation_service_stub.logger - end - - # Service calls - - ## - # Makes a recommendation, which requires a contextual user event. - # - # @overload recommend(request, options = nil) - # Pass arguments to `recommend` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recommend(serving_config: nil, user_event: nil, page_size: nil, filter: nil, validate_only: nil, params: nil, user_labels: nil) - # Pass arguments to `recommend` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: - # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or - # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` - # - # One default serving config is created along with your recommendation engine - # creation. The engine ID is used as the ID of the default serving - # config. For example, for Engine - # `projects/*/locations/global/collections/*/engines/my-engine`, you can use - # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` - # for your - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client#recommend RecommendationService.Recommend} - # requests. - # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # or - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # to a random unique ID and leave - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} - # unset. - # @param page_size [::Integer] - # Maximum number of results to return. Set this property - # to the number of recommendation results needed. If zero, the service - # chooses a reasonable default. The maximum allowed value is 100. Values - # above 100 are set to 100. - # @param filter [::String] - # 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: - # - # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) - # * (available: true) AND - # (language: ANY("en", "es")) OR (categories: ANY("Movie")) - # - # If your filter blocks all results, the API returns generic - # (unfiltered) popular Documents. If you only want results strictly matching - # the filters, set `strictFiltering` to `true` in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} - # to receive empty results instead. - # - # Note that the API never returns - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` - # as `EXPIRED` or `DELETED` regardless of filter choices. - # @param validate_only [::Boolean] - # Use validate only mode for this recommendation query. If set to `true`, a - # fake model is 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. - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # Additional domain specific parameters for the recommendations. - # - # Allowed values: - # - # * `returnDocument`: Boolean. If set to `true`, the associated Document - # object is returned in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. - # * `returnScore`: Boolean. If set to true, the recommendation score - # corresponding to each returned Document is set in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 - # returns 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. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new - # - # # Call the recommend method. - # result = client.recommend request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. - # p result - # - def recommend request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.recommend.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recommend.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recommend.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @recommendation_service_stub.recommend request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the RecommendationService REST API. - # - # This class represents the configuration for RecommendationService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # recommend to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.recommend.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.recommend.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the RecommendationService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `recommend` - # @return [::Gapic::Config::Method] - # - attr_reader :recommend - - # @private - def initialize parent_rpcs = nil - recommend_config = parent_rpcs.recommend if parent_rpcs.respond_to? :recommend - @recommend = ::Gapic::Config::Method.new recommend_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb deleted file mode 100644 index b7bcb64300e4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/service_stub.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/recommendation_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RecommendationService - module Rest - ## - # REST service stub for the RecommendationService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the recommend REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::RecommendResponse] - # A result object deserialized from the server's reply - def recommend request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recommend_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "recommend", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the recommend REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecommendRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recommend_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:recommend", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:recommend", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:recommend", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb deleted file mode 100644 index 24a9ce23296b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/rest.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discovery_engine/v1/search_service/rest" -require "google/cloud/discovery_engine/v1/assistant_service/rest" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest" -require "google/cloud/discovery_engine/v1/completion_service/rest" -require "google/cloud/discovery_engine/v1/control_service/rest" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest" -require "google/cloud/discovery_engine/v1/data_store_service/rest" -require "google/cloud/discovery_engine/v1/document_service/rest" -require "google/cloud/discovery_engine/v1/engine_service/rest" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" -require "google/cloud/discovery_engine/v1/project_service/rest" -require "google/cloud/discovery_engine/v1/rank_service/rest" -require "google/cloud/discovery_engine/v1/recommendation_service/rest" -require "google/cloud/discovery_engine/v1/schema_service/rest" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest" -require "google/cloud/discovery_engine/v1/serving_config_service/rest" -require "google/cloud/discovery_engine/v1/session_service/rest" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" -require "google/cloud/discovery_engine/v1/user_event_service/rest" -require "google/cloud/discovery_engine/v1/user_license_service/rest" -require "google/cloud/discovery_engine/v1/version" - -module Google - module Cloud - module DiscoveryEngine - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/discovery_engine/v1/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb deleted file mode 100644 index 2b84f6382d99..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/schema_service/credentials" -require "google/cloud/discovery_engine/v1/schema_service/paths" -require "google/cloud/discovery_engine/v1/schema_service/operations" -require "google/cloud/discovery_engine/v1/schema_service/client" -require "google/cloud/discovery_engine/v1/schema_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/schema_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/schema_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - module SchemaService - end - end - end - end -end - -helper_path = ::File.join __dir__, "schema_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/schema_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb deleted file mode 100644 index 7dce08dc94fc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +++ /dev/null @@ -1,945 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/schema_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - ## - # Client for the SchemaService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :schema_service_stub - - ## - # Configure the SchemaService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SchemaService clients - # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SchemaService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @schema_service_stub.universe_domain - end - - ## - # Create a new SchemaService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SchemaService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/schema_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @schema_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @schema_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @schema_service_stub.endpoint - config.universe_domain = @schema_service_stub.universe_domain - config.logger = @schema_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @schema_service_stub.logger - end - - # Service calls - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload get_schema(request, options = nil) - # Pass arguments to `get_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_schema(name: nil) - # Pass arguments to `get_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Schema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new - # - # # Call the get_schema method. - # result = client.get_schema request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. - # p result - # - def get_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :get_schema, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - # @overload list_schemas(request, options = nil) - # Pass arguments to `list_schemas` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_schemas(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_schemas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @param page_size [::Integer] - # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to - # return. The service may return fewer than this value. - # - # If unspecified, at most 100 - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. - # - # The maximum value is 1000; values above 1000 are set to 1000. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # must match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new - # - # # Call the list_schemas method. - # result = client.list_schemas request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. - # p item - # end - # - def list_schemas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_schemas.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_schemas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :list_schemas, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @schema_service_stub, :list_schemas, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload create_schema(request, options = nil) - # Pass arguments to `create_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_schema(parent: nil, schema: nil, schema_id: nil) - # Pass arguments to `create_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. - # @param schema_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final - # component of the - # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. - # - # This field should conform to - # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length - # limit of 63 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new - # - # # Call the create_schema method. - # result = client.create_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :create_schema, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload update_schema(request, options = nil) - # Pass arguments to `update_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_schema(schema: nil, allow_missing: nil) - # Pass arguments to `update_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # created. In this situation, `update_mask` is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new - # - # # Call the update_schema method. - # result = client.update_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.schema&.name - header_params["schema.name"] = request.schema.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :update_schema, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload delete_schema(request, options = nil) - # Pass arguments to `delete_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_schema(name: nil) - # Pass arguments to `delete_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new - # - # # Call the delete_schema method. - # result = client.delete_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.call_rpc :delete_schema, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SchemaService API. - # - # This class represents the configuration for SchemaService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_schema to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_schema.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_schema.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SchemaService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_schema - ## - # RPC-specific configuration for `list_schemas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_schemas - ## - # RPC-specific configuration for `create_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :create_schema - ## - # RPC-specific configuration for `update_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_schema - ## - # RPC-specific configuration for `delete_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_schema - - # @private - def initialize parent_rpcs = nil - get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema - @get_schema = ::Gapic::Config::Method.new get_schema_config - list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas - @list_schemas = ::Gapic::Config::Method.new list_schemas_config - create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema - @create_schema = ::Gapic::Config::Method.new create_schema_config - update_schema_config = parent_rpcs.update_schema if parent_rpcs.respond_to? :update_schema - @update_schema = ::Gapic::Config::Method.new update_schema_config - delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema - @delete_schema = ::Gapic::Config::Method.new delete_schema_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb deleted file mode 100644 index c8bc21ee6abf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - # Credentials for the SchemaService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb deleted file mode 100644 index 316822fee1af..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SchemaService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SchemaService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb deleted file mode 100644 index c0a1da46a919..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/paths.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - # Path helper methods for the SchemaService API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Schema resource string. - # - # @overload schema_path(project:, location:, data_store:, schema:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/schemas/{schema}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param schema [String] - # - # @overload schema_path(project:, location:, collection:, data_store:, schema:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param schema [String] - # - # @return [::String] - def schema_path **args - resources = { - "data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/schemas/#{schema}" - end), - "collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/schemas/#{schema}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb deleted file mode 100644 index edb5a4dd991b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/schema_service/credentials" -require "google/cloud/discovery_engine/v1/schema_service/paths" -require "google/cloud/discovery_engine/v1/schema_service/rest/operations" -require "google/cloud/discovery_engine/v1/schema_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/schema_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - module SchemaService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/schema_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb deleted file mode 100644 index e09d0434425e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +++ /dev/null @@ -1,867 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/schema_service_pb" -require "google/cloud/discovery_engine/v1/schema_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - module Rest - ## - # REST client for the SchemaService service. - # - # Service for managing {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :schema_service_stub - - ## - # Configure the SchemaService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SchemaService clients - # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SchemaService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @schema_service_stub.universe_domain - end - - ## - # Create a new SchemaService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SchemaService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @schema_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @schema_service_stub.endpoint - config.universe_domain = @schema_service_stub.universe_domain - config.logger = @schema_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @schema_service_stub.logger - end - - # Service calls - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload get_schema(request, options = nil) - # Pass arguments to `get_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_schema(name: nil) - # Pass arguments to `get_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Schema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new - # - # # Call the get_schema method. - # result = client.get_schema request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. - # p result - # - def get_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.get_schema request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # - # @overload list_schemas(request, options = nil) - # Pass arguments to `list_schemas` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_schemas(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_schemas` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @param page_size [::Integer] - # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to - # return. The service may return fewer than this value. - # - # If unspecified, at most 100 - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. - # - # The maximum value is 1000; values above 1000 are set to 1000. - # @param page_token [::String] - # A page token, received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas} - # must match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new - # - # # Call the list_schemas method. - # result = client.list_schemas request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. - # p item - # end - # - def list_schemas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_schemas.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_schemas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_schemas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.list_schemas request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @schema_service_stub, :list_schemas, "schemas", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload create_schema(request, options = nil) - # Pass arguments to `create_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_schema(parent: nil, schema: nil, schema_id: nil) - # Pass arguments to `create_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. - # @param schema_id [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final - # component of the - # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. - # - # This field should conform to - # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length - # limit of 63 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new - # - # # Call the create_schema method. - # result = client.create_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.create_schema request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload update_schema(request, options = nil) - # Pass arguments to `update_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_schema(schema: nil, allow_missing: nil) - # Pass arguments to `update_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param schema [::Google::Cloud::DiscoveryEngine::V1::Schema, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. - # @param allow_missing [::Boolean] - # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # created. In this situation, `update_mask` is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new - # - # # Call the update_schema method. - # result = client.update_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.update_schema request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}. - # - # @overload delete_schema(request, options = nil) - # Pass arguments to `delete_schema` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_schema(name: nil) - # Pass arguments to `delete_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new - # - # # Call the delete_schema method. - # result = client.delete_schema request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_schema.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @schema_service_stub.delete_schema request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SchemaService REST API. - # - # This class represents the configuration for SchemaService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_schema to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_schema.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_schema.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SchemaService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_schema - ## - # RPC-specific configuration for `list_schemas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_schemas - ## - # RPC-specific configuration for `create_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :create_schema - ## - # RPC-specific configuration for `update_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_schema - ## - # RPC-specific configuration for `delete_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_schema - - # @private - def initialize parent_rpcs = nil - get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema - @get_schema = ::Gapic::Config::Method.new get_schema_config - list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas - @list_schemas = ::Gapic::Config::Method.new list_schemas_config - create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema - @create_schema = ::Gapic::Config::Method.new create_schema_config - update_schema_config = parent_rpcs.update_schema if parent_rpcs.respond_to? :update_schema - @update_schema = ::Gapic::Config::Method.new update_schema_config - delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema - @delete_schema = ::Gapic::Config::Method.new delete_schema_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb deleted file mode 100644 index e3eb1058a4ad..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SchemaService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SchemaService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb deleted file mode 100644 index 4cca0f5c7fd8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/service_stub.rb +++ /dev/null @@ -1,425 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/schema_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SchemaService - module Rest - ## - # REST service stub for the SchemaService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Schema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # A result object deserialized from the server's reply - def get_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Schema.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_schemas REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse] - # A result object deserialized from the server's reply - def list_schemas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_schemas_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_schemas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_schema_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_schemas REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_schemas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/schemas", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/schemas", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/schemas", - body: "schema", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/schemas", - body: "schema", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{schema.name}", - body: "schema", - matches: [ - ["schema.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{schema.name}", - body: "schema", - matches: [ - ["schema.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_schema REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb deleted file mode 100644 index aaac77819f3f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/search_service/credentials" -require "google/cloud/discovery_engine/v1/search_service/paths" -require "google/cloud/discovery_engine/v1/search_service/client" -require "google/cloud/discovery_engine/v1/search_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for search. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/search_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/search_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - module SearchService - end - end - end - end -end - -helper_path = ::File.join __dir__, "search_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/search_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb deleted file mode 100644 index 774cafd0012c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb +++ /dev/null @@ -1,1315 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/search_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - ## - # Client for the SearchService service. - # - # Service for search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_service_stub - - ## - # Configure the SearchService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchService clients - # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @search_service_stub.universe_domain - end - - ## - # Create a new SearchService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/search_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @search_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::SearchService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @search_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_service_stub.endpoint - config.universe_domain = @search_service_stub.universe_domain - config.logger = @search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_service_stub.logger - end - - # Service calls - - ## - # Performs a search. - # - # @overload search(request, options = nil) - # Pass arguments to `search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) - # Pass arguments to `search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `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. - # @param branch [::String] - # 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. - # @param query [::String] - # Raw search query. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. - # This field is the equivalent of the query for browse (navigation) queries. - # It's used by the browse model when the query is empty. - # - # If the field is empty, it will not be used by the browse model. - # If the field contains more than one element, only the first element will - # be used. - # - # To represent full path of a category, use '>' character to separate - # different hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > - # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 - # > Founders Edition` - # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] - # Raw image query. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. The maximum allowed value depends on the data type. Values above - # the maximum value are coerced to the maximum value. - # - # * Websites with basic indexing: Default `10`, Maximum `25`. - # * Websites with advanced indexing: Default `25`, Maximum `50`. - # * Other: Default `50`, Maximum `100`. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @param page_token [::String] - # A page token received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as - # relevant) in search results. This field is only considered if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is - # unset. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # - # A large offset may be capped to a reasonable threshold. - # @param one_box_page_size [::Integer] - # The maximum number of results to return for OneBox. - # This applies to each OneBox type individually. - # Default number is 10. - # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] - # Specifications that define the specific - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, - # along with configurations for those data stores. This is only considered - # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data - # stores. For engines with a single data store, the specs directly under - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be - # used. - # @param filter [::String] - # 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which documents are returned. Documents can be ordered by - # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. - # Leave it unset if ordered by relevance. `order_by` expression is - # case-sensitive. - # - # For more information on ordering the website search results, see - # [Order web search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). - # For more information on ordering the healthcare search results, see - # [Order healthcare search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] - # Information about the end user. - # Highly recommended for analytics and personalization. - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} - # is used to deduce `device_type` for analytics. - # @param language_code [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see [Standard - # fields](https://cloud.google.com/apis/design/standard_fields). This field - # helps to better interpret the query. If a value isn't specified, the query - # language code is automatically detected, which may not be accurate. - # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] - # 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. - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # 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. - # For example, `user_country_code: "au"` - # - # For available codes see [Country - # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) - # - # * `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. - # For example, `search_type: 1` - # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. - # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction takes effect. - # @param user_pseudo_id [::String] - # Optional. 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. - # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] - # A specification for configuring the behavior of content search. - # @param ranking_expression [::String] - # Optional. The ranking expression controls the customized ranking on - # retrieval documents. This overrides - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. - # The syntax and supported features depend on the - # `ranking_expression_backend` value. If `ranking_expression_backend` is not - # provided, it defaults to `RANK_BY_EMBEDDING`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single - # function or multiple functions that are joined 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)`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is set to `RANK_BY_FORMULA`, the following expression types (and - # combinations of those chained using + or - # * operators) are supported: - # - # * `double` - # * `signal` - # * `log(signal)` - # * `exp(signal)` - # * `rr(signal, double > 0)` -- reciprocal rank transformation with second - # argument being a denominator constant. - # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. - # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns - # signal2 | double, else returns signal1. - # - # Here are a few examples of ranking formulas that use the supported - # ranking expression types: - # - # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` - # -- mostly rank by the logarithm of `keyword_similarity_score` with slight - # `semantic_smilarity_score` adjustment. - # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * - # is_nan(keyword_similarity_score)` -- rank by the exponent of - # `semantic_similarity_score` filling the value with 0 if it's NaN, also - # add constant 0.3 adjustment to the final score if - # `semantic_similarity_score` is NaN. - # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * - # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank - # of `keyword_similarity_score` with slight adjustment of reciprocal rank - # of `semantic_smilarity_score`. - # - # The following signals are supported: - # - # * `semantic_similarity_score`: semantic similarity adjustment that is - # calculated using the embeddings generated by a proprietary Google model. - # This score determines how semantically similar a search query is to a - # document. - # * `keyword_similarity_score`: keyword match adjustment uses the Best - # Match 25 (BM25) ranking function. This score is calculated using a - # probabilistic model to estimate the probability that a document is - # relevant to a given query. - # * `relevance_score`: semantic relevance adjustment that uses a - # proprietary Google model to determine the meaning and intent behind a - # user's query in context with the content in the documents. - # * `pctr_rank`: predicted conversion rate adjustment as a rank use - # predicted Click-through rate (pCTR) to gauge the relevance and - # attractiveness of a search result from a user's perspective. A higher - # pCTR suggests that the result is more likely to satisfy the user's query - # and intent, making it a valuable signal for ranking. - # * `freshness_rank`: freshness adjustment as a rank - # * `document_age`: The time in hours elapsed since the document was last - # updated, a floating-point number (e.g., 0.25 means 15 minutes). - # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary - # Google model to determine the keyword-based overlap between the query and - # the document. - # * `base_rank`: the default rank of the result - # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # Optional. The backend to use for the ranking expression evaluation. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] - # Optional. Config for natural language query understanding capabilities, - # such as extracting structured field filters from the query. Refer to [this - # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) - # for more information. - # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional - # natural language query understanding will be done. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] - # Optional. Crowding specifications for improving result diversity. - # If multiple CrowdingSpecs are specified, crowding will be evaluated on - # each unique combination of the `field` values, and max_count will be the - # maximum value of `max_count` across all CrowdingSpecs. - # For example, if the first CrowdingSpec has `field` = "color" and - # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and - # `max_count` = 2, then after 3 documents that share the same color AND size - # have been returned, subsequent ones should be - # removed or demoted. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The global relevance threshold of the search results. - # - # Defaults to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # If more granular relevance filtering is required, use the - # `relevance_filter_spec` instead. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - # - # # Call the search method. - # result = client.search request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - # p item - # end - # - def search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.search.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.call_rpc :search, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @search_service_stub, :search, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs a search. Similar to the - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # method, but a lite version that allows API key for authentication, where - # OAuth and IAM checks are not required. - # - # Only public website search is supported by this method. If data stores and - # engines not associated with public website search are specified, a - # `FAILED_PRECONDITION` error is returned. - # - # This method can be used for easy onboarding without having to implement an - # authentication backend. However, it is strongly recommended to use - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # instead with required OAuth and IAM checks to provide better data security. - # - # @overload search_lite(request, options = nil) - # Pass arguments to `search_lite` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) - # Pass arguments to `search_lite` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `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. - # @param branch [::String] - # 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. - # @param query [::String] - # Raw search query. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. - # This field is the equivalent of the query for browse (navigation) queries. - # It's used by the browse model when the query is empty. - # - # If the field is empty, it will not be used by the browse model. - # If the field contains more than one element, only the first element will - # be used. - # - # To represent full path of a category, use '>' character to separate - # different hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > - # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 - # > Founders Edition` - # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] - # Raw image query. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. The maximum allowed value depends on the data type. Values above - # the maximum value are coerced to the maximum value. - # - # * Websites with basic indexing: Default `10`, Maximum `25`. - # * Websites with advanced indexing: Default `25`, Maximum `50`. - # * Other: Default `50`, Maximum `100`. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @param page_token [::String] - # A page token received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as - # relevant) in search results. This field is only considered if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is - # unset. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # - # A large offset may be capped to a reasonable threshold. - # @param one_box_page_size [::Integer] - # The maximum number of results to return for OneBox. - # This applies to each OneBox type individually. - # Default number is 10. - # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] - # Specifications that define the specific - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, - # along with configurations for those data stores. This is only considered - # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data - # stores. For engines with a single data store, the specs directly under - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be - # used. - # @param filter [::String] - # 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which documents are returned. Documents can be ordered by - # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. - # Leave it unset if ordered by relevance. `order_by` expression is - # case-sensitive. - # - # For more information on ordering the website search results, see - # [Order web search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). - # For more information on ordering the healthcare search results, see - # [Order healthcare search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] - # Information about the end user. - # Highly recommended for analytics and personalization. - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} - # is used to deduce `device_type` for analytics. - # @param language_code [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see [Standard - # fields](https://cloud.google.com/apis/design/standard_fields). This field - # helps to better interpret the query. If a value isn't specified, the query - # language code is automatically detected, which may not be accurate. - # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] - # 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. - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # 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. - # For example, `user_country_code: "au"` - # - # For available codes see [Country - # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) - # - # * `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. - # For example, `search_type: 1` - # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. - # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction takes effect. - # @param user_pseudo_id [::String] - # Optional. 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. - # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] - # A specification for configuring the behavior of content search. - # @param ranking_expression [::String] - # Optional. The ranking expression controls the customized ranking on - # retrieval documents. This overrides - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. - # The syntax and supported features depend on the - # `ranking_expression_backend` value. If `ranking_expression_backend` is not - # provided, it defaults to `RANK_BY_EMBEDDING`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single - # function or multiple functions that are joined 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)`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is set to `RANK_BY_FORMULA`, the following expression types (and - # combinations of those chained using + or - # * operators) are supported: - # - # * `double` - # * `signal` - # * `log(signal)` - # * `exp(signal)` - # * `rr(signal, double > 0)` -- reciprocal rank transformation with second - # argument being a denominator constant. - # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. - # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns - # signal2 | double, else returns signal1. - # - # Here are a few examples of ranking formulas that use the supported - # ranking expression types: - # - # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` - # -- mostly rank by the logarithm of `keyword_similarity_score` with slight - # `semantic_smilarity_score` adjustment. - # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * - # is_nan(keyword_similarity_score)` -- rank by the exponent of - # `semantic_similarity_score` filling the value with 0 if it's NaN, also - # add constant 0.3 adjustment to the final score if - # `semantic_similarity_score` is NaN. - # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * - # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank - # of `keyword_similarity_score` with slight adjustment of reciprocal rank - # of `semantic_smilarity_score`. - # - # The following signals are supported: - # - # * `semantic_similarity_score`: semantic similarity adjustment that is - # calculated using the embeddings generated by a proprietary Google model. - # This score determines how semantically similar a search query is to a - # document. - # * `keyword_similarity_score`: keyword match adjustment uses the Best - # Match 25 (BM25) ranking function. This score is calculated using a - # probabilistic model to estimate the probability that a document is - # relevant to a given query. - # * `relevance_score`: semantic relevance adjustment that uses a - # proprietary Google model to determine the meaning and intent behind a - # user's query in context with the content in the documents. - # * `pctr_rank`: predicted conversion rate adjustment as a rank use - # predicted Click-through rate (pCTR) to gauge the relevance and - # attractiveness of a search result from a user's perspective. A higher - # pCTR suggests that the result is more likely to satisfy the user's query - # and intent, making it a valuable signal for ranking. - # * `freshness_rank`: freshness adjustment as a rank - # * `document_age`: The time in hours elapsed since the document was last - # updated, a floating-point number (e.g., 0.25 means 15 minutes). - # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary - # Google model to determine the keyword-based overlap between the query and - # the document. - # * `base_rank`: the default rank of the result - # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # Optional. The backend to use for the ranking expression evaluation. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] - # Optional. Config for natural language query understanding capabilities, - # such as extracting structured field filters from the query. Refer to [this - # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) - # for more information. - # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional - # natural language query understanding will be done. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] - # Optional. Crowding specifications for improving result diversity. - # If multiple CrowdingSpecs are specified, crowding will be evaluated on - # each unique combination of the `field` values, and max_count will be the - # maximum value of `max_count` across all CrowdingSpecs. - # For example, if the first CrowdingSpec has `field` = "color" and - # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and - # `max_count` = 2, then after 3 documents that share the same color AND size - # have been returned, subsequent ones should be - # removed or demoted. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The global relevance threshold of the search results. - # - # Defaults to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # If more granular relevance filtering is required, use the - # `relevance_filter_spec` instead. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - # - # # Call the search_lite method. - # result = client.search_lite request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - # p item - # end - # - def search_lite request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.search_lite.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config - header_params["serving_config"] = request.serving_config - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.search_lite.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_lite.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.call_rpc :search_lite, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @search_service_stub, :search_lite, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SearchService API. - # - # This class represents the configuration for SearchService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SearchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `search` - # @return [::Gapic::Config::Method] - # - attr_reader :search - ## - # RPC-specific configuration for `search_lite` - # @return [::Gapic::Config::Method] - # - attr_reader :search_lite - - # @private - def initialize parent_rpcs = nil - search_config = parent_rpcs.search if parent_rpcs.respond_to? :search - @search = ::Gapic::Config::Method.new search_config - search_lite_config = parent_rpcs.search_lite if parent_rpcs.respond_to? :search_lite - @search_lite = ::Gapic::Config::Method.new search_lite_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb deleted file mode 100644 index 50b917e729ce..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - # Credentials for the SearchService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb deleted file mode 100644 index e3827042aa03..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +++ /dev/null @@ -1,263 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - # Path helper methods for the SearchService API. - module Paths - ## - # Create a fully-qualified Branch resource string. - # - # @overload branch_path(project:, location:, data_store:, branch:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # - # @overload branch_path(project:, location:, collection:, data_store:, branch:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # - # @return [::String] - def branch_path **args - resources = { - "branch:data_store:location:project" => (proc do |project:, location:, data_store:, branch:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}" - end), - "branch:collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, branch:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified ServingConfig resource string. - # - # @overload serving_config_path(project:, location:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path **args - resources = { - "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, engine:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb deleted file mode 100644 index c3a52f5574f7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/search_service/credentials" -require "google/cloud/discovery_engine/v1/search_service/paths" -require "google/cloud/discovery_engine/v1/search_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for search. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/search_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - module SearchService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/search_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb deleted file mode 100644 index fcf1e19913e9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +++ /dev/null @@ -1,1258 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/search_service_pb" -require "google/cloud/discovery_engine/v1/search_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - module Rest - ## - # REST client for the SearchService service. - # - # Service for search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_service_stub - - ## - # Configure the SearchService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchService clients - # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @search_service_stub.universe_domain - end - - ## - # Create a new SearchService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @search_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @search_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_service_stub.endpoint - config.universe_domain = @search_service_stub.universe_domain - config.logger = @search_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_service_stub.logger - end - - # Service calls - - ## - # Performs a search. - # - # @overload search(request, options = nil) - # Pass arguments to `search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) - # Pass arguments to `search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `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. - # @param branch [::String] - # 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. - # @param query [::String] - # Raw search query. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. - # This field is the equivalent of the query for browse (navigation) queries. - # It's used by the browse model when the query is empty. - # - # If the field is empty, it will not be used by the browse model. - # If the field contains more than one element, only the first element will - # be used. - # - # To represent full path of a category, use '>' character to separate - # different hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > - # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 - # > Founders Edition` - # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] - # Raw image query. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. The maximum allowed value depends on the data type. Values above - # the maximum value are coerced to the maximum value. - # - # * Websites with basic indexing: Default `10`, Maximum `25`. - # * Websites with advanced indexing: Default `25`, Maximum `50`. - # * Other: Default `50`, Maximum `100`. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @param page_token [::String] - # A page token received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as - # relevant) in search results. This field is only considered if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is - # unset. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # - # A large offset may be capped to a reasonable threshold. - # @param one_box_page_size [::Integer] - # The maximum number of results to return for OneBox. - # This applies to each OneBox type individually. - # Default number is 10. - # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] - # Specifications that define the specific - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, - # along with configurations for those data stores. This is only considered - # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data - # stores. For engines with a single data store, the specs directly under - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be - # used. - # @param filter [::String] - # 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which documents are returned. Documents can be ordered by - # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. - # Leave it unset if ordered by relevance. `order_by` expression is - # case-sensitive. - # - # For more information on ordering the website search results, see - # [Order web search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). - # For more information on ordering the healthcare search results, see - # [Order healthcare search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] - # Information about the end user. - # Highly recommended for analytics and personalization. - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} - # is used to deduce `device_type` for analytics. - # @param language_code [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see [Standard - # fields](https://cloud.google.com/apis/design/standard_fields). This field - # helps to better interpret the query. If a value isn't specified, the query - # language code is automatically detected, which may not be accurate. - # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] - # 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. - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # 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. - # For example, `user_country_code: "au"` - # - # For available codes see [Country - # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) - # - # * `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. - # For example, `search_type: 1` - # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. - # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction takes effect. - # @param user_pseudo_id [::String] - # Optional. 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. - # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] - # A specification for configuring the behavior of content search. - # @param ranking_expression [::String] - # Optional. The ranking expression controls the customized ranking on - # retrieval documents. This overrides - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. - # The syntax and supported features depend on the - # `ranking_expression_backend` value. If `ranking_expression_backend` is not - # provided, it defaults to `RANK_BY_EMBEDDING`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single - # function or multiple functions that are joined 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)`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is set to `RANK_BY_FORMULA`, the following expression types (and - # combinations of those chained using + or - # * operators) are supported: - # - # * `double` - # * `signal` - # * `log(signal)` - # * `exp(signal)` - # * `rr(signal, double > 0)` -- reciprocal rank transformation with second - # argument being a denominator constant. - # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. - # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns - # signal2 | double, else returns signal1. - # - # Here are a few examples of ranking formulas that use the supported - # ranking expression types: - # - # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` - # -- mostly rank by the logarithm of `keyword_similarity_score` with slight - # `semantic_smilarity_score` adjustment. - # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * - # is_nan(keyword_similarity_score)` -- rank by the exponent of - # `semantic_similarity_score` filling the value with 0 if it's NaN, also - # add constant 0.3 adjustment to the final score if - # `semantic_similarity_score` is NaN. - # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * - # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank - # of `keyword_similarity_score` with slight adjustment of reciprocal rank - # of `semantic_smilarity_score`. - # - # The following signals are supported: - # - # * `semantic_similarity_score`: semantic similarity adjustment that is - # calculated using the embeddings generated by a proprietary Google model. - # This score determines how semantically similar a search query is to a - # document. - # * `keyword_similarity_score`: keyword match adjustment uses the Best - # Match 25 (BM25) ranking function. This score is calculated using a - # probabilistic model to estimate the probability that a document is - # relevant to a given query. - # * `relevance_score`: semantic relevance adjustment that uses a - # proprietary Google model to determine the meaning and intent behind a - # user's query in context with the content in the documents. - # * `pctr_rank`: predicted conversion rate adjustment as a rank use - # predicted Click-through rate (pCTR) to gauge the relevance and - # attractiveness of a search result from a user's perspective. A higher - # pCTR suggests that the result is more likely to satisfy the user's query - # and intent, making it a valuable signal for ranking. - # * `freshness_rank`: freshness adjustment as a rank - # * `document_age`: The time in hours elapsed since the document was last - # updated, a floating-point number (e.g., 0.25 means 15 minutes). - # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary - # Google model to determine the keyword-based overlap between the query and - # the document. - # * `base_rank`: the default rank of the result - # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # Optional. The backend to use for the ranking expression evaluation. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] - # Optional. Config for natural language query understanding capabilities, - # such as extracting structured field filters from the query. Refer to [this - # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) - # for more information. - # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional - # natural language query understanding will be done. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] - # Optional. Crowding specifications for improving result diversity. - # If multiple CrowdingSpecs are specified, crowding will be evaluated on - # each unique combination of the `field` values, and max_count will be the - # maximum value of `max_count` across all CrowdingSpecs. - # For example, if the first CrowdingSpec has `field` = "color" and - # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and - # `max_count` = 2, then after 3 documents that share the same color AND size - # have been returned, subsequent ones should be - # removed or demoted. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The global relevance threshold of the search results. - # - # Defaults to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # If more granular relevance filtering is required, use the - # `relevance_filter_spec` instead. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - # - # # Call the search method. - # result = client.search request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - # p item - # end - # - def search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.search.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.search request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search, "results", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs a search. Similar to the - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # method, but a lite version that allows API key for authentication, where - # OAuth and IAM checks are not required. - # - # Only public website search is supported by this method. If data stores and - # engines not associated with public website search are specified, a - # `FAILED_PRECONDITION` error is returned. - # - # This method can be used for easy onboarding without having to implement an - # authentication backend. However, it is strongly recommended to use - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # instead with required OAuth and IAM checks to provide better data security. - # - # @overload search_lite(request, options = nil) - # Pass arguments to `search_lite` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_lite(serving_config: nil, branch: nil, query: nil, page_categories: nil, image_query: nil, page_size: nil, page_token: nil, offset: nil, one_box_page_size: nil, data_store_specs: nil, filter: nil, canonical_filter: nil, order_by: nil, user_info: nil, language_code: nil, facet_specs: nil, boost_spec: nil, params: nil, query_expansion_spec: nil, spell_correction_spec: nil, user_pseudo_id: nil, content_search_spec: nil, ranking_expression: nil, ranking_expression_backend: nil, safe_search: nil, user_labels: nil, natural_language_query_understanding_spec: nil, search_as_you_type_spec: nil, display_spec: nil, crowding_specs: nil, session: nil, session_spec: nil, relevance_threshold: nil, relevance_score_spec: nil) - # Pass arguments to `search_lite` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `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. - # @param branch [::String] - # 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. - # @param query [::String] - # Raw search query. - # @param page_categories [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. - # This field is the equivalent of the query for browse (navigation) queries. - # It's used by the browse model when the query is empty. - # - # If the field is empty, it will not be used by the browse model. - # If the field contains more than one element, only the first element will - # be used. - # - # To represent full path of a category, use '>' character to separate - # different hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > - # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 - # > Founders Edition` - # @param image_query [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery, ::Hash] - # Raw image query. - # @param page_size [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. The maximum allowed value depends on the data type. Values above - # the maximum value are coerced to the maximum value. - # - # * Websites with basic indexing: Default `10`, Maximum `25`. - # * Websites with advanced indexing: Default `25`, Maximum `50`. - # * Other: Default `50`, Maximum `100`. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @param page_token [::String] - # A page token received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client#search SearchService.Search} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @param offset [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as - # relevant) in search results. This field is only considered if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is - # unset. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # - # A large offset may be capped to a reasonable threshold. - # @param one_box_page_size [::Integer] - # The maximum number of results to return for OneBox. - # This applies to each OneBox type individually. - # Default number is 10. - # @param data_store_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, ::Hash>] - # Specifications that define the specific - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, - # along with configurations for those data stores. This is only considered - # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data - # stores. For engines with a single data store, the specs directly under - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be - # used. - # @param filter [::String] - # 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @param canonical_filter [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @param order_by [::String] - # The order in which documents are returned. Documents can be ordered by - # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. - # Leave it unset if ordered by relevance. `order_by` expression is - # case-sensitive. - # - # For more information on ordering the website search results, see - # [Order web search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). - # For more information on ordering the healthcare search results, see - # [Order healthcare search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @param user_info [::Google::Cloud::DiscoveryEngine::V1::UserInfo, ::Hash] - # Information about the end user. - # Highly recommended for analytics and personalization. - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} - # is used to deduce `device_type` for analytics. - # @param language_code [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see [Standard - # fields](https://cloud.google.com/apis/design/standard_fields). This field - # helps to better interpret the query. If a value isn't specified, the query - # language code is automatically detected, which may not be accurate. - # @param facet_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, ::Hash>] - # 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. - # @param boost_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec, ::Hash] - # Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}] - # 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. - # For example, `user_country_code: "au"` - # - # For available codes see [Country - # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) - # - # * `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. - # For example, `search_type: 1` - # @param query_expansion_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec, ::Hash] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. - # @param spell_correction_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec, ::Hash] - # The spell correction specification that specifies the mode under - # which spell correction takes effect. - # @param user_pseudo_id [::String] - # Optional. 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. - # @param content_search_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec, ::Hash] - # A specification for configuring the behavior of content search. - # @param ranking_expression [::String] - # Optional. The ranking expression controls the customized ranking on - # retrieval documents. This overrides - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. - # The syntax and supported features depend on the - # `ranking_expression_backend` value. If `ranking_expression_backend` is not - # provided, it defaults to `RANK_BY_EMBEDDING`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single - # function or multiple functions that are joined 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)`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is set to `RANK_BY_FORMULA`, the following expression types (and - # combinations of those chained using + or - # * operators) are supported: - # - # * `double` - # * `signal` - # * `log(signal)` - # * `exp(signal)` - # * `rr(signal, double > 0)` -- reciprocal rank transformation with second - # argument being a denominator constant. - # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. - # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns - # signal2 | double, else returns signal1. - # - # Here are a few examples of ranking formulas that use the supported - # ranking expression types: - # - # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` - # -- mostly rank by the logarithm of `keyword_similarity_score` with slight - # `semantic_smilarity_score` adjustment. - # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * - # is_nan(keyword_similarity_score)` -- rank by the exponent of - # `semantic_similarity_score` filling the value with 0 if it's NaN, also - # add constant 0.3 adjustment to the final score if - # `semantic_similarity_score` is NaN. - # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * - # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank - # of `keyword_similarity_score` with slight adjustment of reciprocal rank - # of `semantic_smilarity_score`. - # - # The following signals are supported: - # - # * `semantic_similarity_score`: semantic similarity adjustment that is - # calculated using the embeddings generated by a proprietary Google model. - # This score determines how semantically similar a search query is to a - # document. - # * `keyword_similarity_score`: keyword match adjustment uses the Best - # Match 25 (BM25) ranking function. This score is calculated using a - # probabilistic model to estimate the probability that a document is - # relevant to a given query. - # * `relevance_score`: semantic relevance adjustment that uses a - # proprietary Google model to determine the meaning and intent behind a - # user's query in context with the content in the documents. - # * `pctr_rank`: predicted conversion rate adjustment as a rank use - # predicted Click-through rate (pCTR) to gauge the relevance and - # attractiveness of a search result from a user's perspective. A higher - # pCTR suggests that the result is more likely to satisfy the user's query - # and intent, making it a valuable signal for ranking. - # * `freshness_rank`: freshness adjustment as a rank - # * `document_age`: The time in hours elapsed since the document was last - # updated, a floating-point number (e.g., 0.25 means 15 minutes). - # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary - # Google model to determine the keyword-based overlap between the query and - # the document. - # * `base_rank`: the default rank of the result - # @param ranking_expression_backend [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # Optional. The backend to use for the ranking expression evaluation. - # @param safe_search [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @param user_labels [::Hash{::String => ::String}] - # 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. - # @param natural_language_query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec, ::Hash] - # Optional. Config for natural language query understanding capabilities, - # such as extracting structured field filters from the query. Refer to [this - # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) - # for more information. - # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional - # natural language query understanding will be done. - # @param search_as_you_type_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec, ::Hash] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @param display_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec, ::Hash] - # Optional. Config for display feature, like match highlighting on search - # results. - # @param crowding_specs [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, ::Hash>] - # Optional. Crowding specifications for improving result diversity. - # If multiple CrowdingSpecs are specified, crowding will be evaluated on - # each unique combination of the `field` values, and max_count will be the - # maximum value of `max_count` across all CrowdingSpecs. - # For example, if the first CrowdingSpec has `field` = "color" and - # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and - # `max_count` = 2, then after 3 documents that share the same color AND size - # have been returned, subsequent ones should be - # removed or demoted. - # @param session [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @param session_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec, ::Hash] - # Session specification. - # - # Can be used only when `session` is set. - # @param relevance_threshold [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The global relevance threshold of the search results. - # - # Defaults to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # If more granular relevance filtering is required, use the - # `relevance_filter_spec` instead. - # - # This feature is not supported for healthcare search. - # @param relevance_score_spec [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec, ::Hash] - # Optional. The specification for returning the relevance score. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - # - # # Call the search_lite method. - # result = client.search_lite request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - # p item - # end - # - def search_lite request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.search_lite.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.search_lite.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_lite.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_service_stub.search_lite request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @search_service_stub, :search_lite, "results", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SearchService REST API. - # - # This class represents the configuration for SearchService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # search to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.search.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SearchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `search` - # @return [::Gapic::Config::Method] - # - attr_reader :search - ## - # RPC-specific configuration for `search_lite` - # @return [::Gapic::Config::Method] - # - attr_reader :search_lite - - # @private - def initialize parent_rpcs = nil - search_config = parent_rpcs.search if parent_rpcs.respond_to? :search - @search = ::Gapic::Config::Method.new search_config - search_lite_config = parent_rpcs.search_lite if parent_rpcs.respond_to? :search_lite - @search_lite = ::Gapic::Config::Method.new search_lite_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb deleted file mode 100644 index eed90b551bda..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +++ /dev/null @@ -1,237 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/search_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - module Rest - ## - # REST service stub for the SearchService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] - # A result object deserialized from the server's reply - def search request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "search", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_lite REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] - # A result object deserialized from the server's reply - def search_lite request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_lite_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "search_lite", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:search", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:search", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:search", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_lite REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_lite_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:searchLite", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:searchLite", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{serving_config}:searchLite", - body: "*", - matches: [ - ["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb deleted file mode 100644 index 613e532121c6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/search_tuning_service/credentials" -require "google/cloud/discovery_engine/v1/search_tuning_service/paths" -require "google/cloud/discovery_engine/v1/search_tuning_service/operations" -require "google/cloud/discovery_engine/v1/search_tuning_service/client" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for search tuning. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/search_tuning_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/search_tuning_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new - # - module SearchTuningService - end - end - end - end -end - -helper_path = ::File.join __dir__, "search_tuning_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/search_tuning_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb deleted file mode 100644 index ae0e87539eac..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/client.rb +++ /dev/null @@ -1,621 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - ## - # Client for the SearchTuningService service. - # - # Service for search tuning. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_tuning_service_stub - - ## - # Configure the SearchTuningService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchTuningService clients - # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchTuningService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @search_tuning_service_stub.universe_domain - end - - ## - # Create a new SearchTuningService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchTuningService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/search_tuning_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @search_tuning_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @search_tuning_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_tuning_service_stub.endpoint - config.universe_domain = @search_tuning_service_stub.universe_domain - config.logger = @search_tuning_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_tuning_service_stub.logger - end - - # Service calls - - ## - # Trains a custom model. - # - # @overload train_custom_model(request, options = nil) - # Pass arguments to `train_custom_model` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) - # Pass arguments to `train_custom_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_training_input [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput, ::Hash] - # Cloud Storage training input. - # @param data_store [::String] - # Required. The resource name of the Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to train the models. - # @param model_type [::String] - # Model to be trained. Supported values are: - # - # * **search-tuning**: Fine tuning the search system based on data provided. - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the data ingestion and - # training. - # @param model_id [::String] - # If not provided, a UUID will be generated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new - # - # # Call the train_custom_model method. - # result = client.train_custom_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def train_custom_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.train_custom_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.data_store - header_params["data_store"] = request.data_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.train_custom_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_tuning_service_stub.call_rpc :train_custom_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of all the custom models. - # - # @overload list_custom_models(request, options = nil) - # Pass arguments to `list_custom_models` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_custom_models(data_store: nil) - # Pass arguments to `list_custom_models` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::String] - # Required. The resource name of the parent Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to fetch the models - # from. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new - # - # # Call the list_custom_models method. - # result = client.list_custom_models request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. - # p result - # - def list_custom_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_custom_models.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.data_store - header_params["data_store"] = request.data_store - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_tuning_service_stub.call_rpc :list_custom_models, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SearchTuningService API. - # - # This class represents the configuration for SearchTuningService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # train_custom_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.train_custom_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.train_custom_model.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SearchTuningService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `train_custom_model` - # @return [::Gapic::Config::Method] - # - attr_reader :train_custom_model - ## - # RPC-specific configuration for `list_custom_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_models - - # @private - def initialize parent_rpcs = nil - train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model - @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config - list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models - @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb deleted file mode 100644 index 249bc36141d8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - # Credentials for the SearchTuningService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb deleted file mode 100644 index eb41e7486946..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SearchTuningService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchTuningService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb deleted file mode 100644 index 36e74c2d4ed3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/paths.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - # Path helper methods for the SearchTuningService API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb deleted file mode 100644 index 5d4464762e5f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/search_tuning_service/credentials" -require "google/cloud/discovery_engine/v1/search_tuning_service/paths" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest/operations" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for search tuning. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/search_tuning_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new - # - module SearchTuningService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb deleted file mode 100644 index 1470edaef33c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/client.rb +++ /dev/null @@ -1,564 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - module Rest - ## - # REST client for the SearchTuningService service. - # - # Service for search tuning. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :search_tuning_service_stub - - ## - # Configure the SearchTuningService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SearchTuningService clients - # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchTuningService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @search_tuning_service_stub.universe_domain - end - - ## - # Create a new SearchTuningService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SearchTuningService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @search_tuning_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @search_tuning_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @search_tuning_service_stub.endpoint - config.universe_domain = @search_tuning_service_stub.universe_domain - config.logger = @search_tuning_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @search_tuning_service_stub.logger - end - - # Service calls - - ## - # Trains a custom model. - # - # @overload train_custom_model(request, options = nil) - # Pass arguments to `train_custom_model` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil) - # Pass arguments to `train_custom_model` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_training_input [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput, ::Hash] - # Cloud Storage training input. - # @param data_store [::String] - # Required. The resource name of the Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to train the models. - # @param model_type [::String] - # Model to be trained. Supported values are: - # - # * **search-tuning**: Fine tuning the search system based on data provided. - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the data ingestion and - # training. - # @param model_id [::String] - # If not provided, a UUID will be generated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new - # - # # Call the train_custom_model method. - # result = client.train_custom_model request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def train_custom_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.train_custom_model.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.train_custom_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_tuning_service_stub.train_custom_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of all the custom models. - # - # @overload list_custom_models(request, options = nil) - # Pass arguments to `list_custom_models` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_custom_models(data_store: nil) - # Pass arguments to `list_custom_models` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_store [::String] - # Required. The resource name of the parent Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to fetch the models - # from. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new - # - # # Call the list_custom_models method. - # result = client.list_custom_models request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. - # p result - # - def list_custom_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_custom_models.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @search_tuning_service_stub.list_custom_models request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SearchTuningService REST API. - # - # This class represents the configuration for SearchTuningService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # train_custom_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.train_custom_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.train_custom_model.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SearchTuningService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `train_custom_model` - # @return [::Gapic::Config::Method] - # - attr_reader :train_custom_model - ## - # RPC-specific configuration for `list_custom_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_models - - # @private - def initialize parent_rpcs = nil - train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model - @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config - list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models - @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb deleted file mode 100644 index 738b662cbeae..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SearchTuningService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SearchTuningService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb deleted file mode 100644 index 732a08aab3cb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/service_stub.rb +++ /dev/null @@ -1,204 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - module Rest - ## - # REST service stub for the SearchTuningService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the train_custom_model REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def train_custom_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_train_custom_model_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "train_custom_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_custom_models REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse] - # A result object deserialized from the server's reply - def list_custom_models request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_models_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_custom_models", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the train_custom_model REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_train_custom_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{data_store}:trainCustomModel", - body: "*", - matches: [ - ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_models REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_custom_models_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{data_store}/customModels", - matches: [ - ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb deleted file mode 100644 index 29c8d59857e0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/serving_config_service/credentials" -require "google/cloud/discovery_engine/v1/serving_config_service/paths" -require "google/cloud/discovery_engine/v1/serving_config_service/client" -require "google/cloud/discovery_engine/v1/serving_config_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for operations related to - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/serving_config_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/serving_config_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new - # - module ServingConfigService - end - end - end - end -end - -helper_path = ::File.join __dir__, "serving_config_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/serving_config_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb deleted file mode 100644 index c1aa34c248ac..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb +++ /dev/null @@ -1,501 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/serving_config_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ServingConfigService - ## - # Client for the ServingConfigService service. - # - # Service for operations related to - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :serving_config_service_stub - - ## - # Configure the ServingConfigService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServingConfigService clients - # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServingConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @serving_config_service_stub.universe_domain - end - - ## - # Create a new ServingConfigService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServingConfigService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/serving_config_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @serving_config_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @serving_config_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @serving_config_service_stub.endpoint - config.universe_domain = @serving_config_service_stub.universe_domain - config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @serving_config_service_stub.logger - end - - # Service calls - - ## - # Updates a ServingConfig. - # - # Returns a NOT_FOUND error if the ServingConfig does not exist. - # - # @overload update_serving_config(request, options = nil) - # Pass arguments to `update_serving_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_serving_config(serving_config: nil, update_mask: nil) - # Pass arguments to `update_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::Google::Cloud::DiscoveryEngine::V1::ServingConfig, ::Hash] - # Required. The ServingConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. - # The following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new - # - # # Call the update_serving_config method. - # result = client.update_serving_config request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. - # p result - # - def update_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.serving_config&.name - header_params["serving_config.name"] = request.serving_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ServingConfigService API. - # - # This class represents the configuration for ServingConfigService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_serving_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_serving_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_serving_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ServingConfigService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_serving_config - - # @private - def initialize parent_rpcs = nil - update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config - @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb deleted file mode 100644 index 51723767eb9d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ServingConfigService - # Credentials for the ServingConfigService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb deleted file mode 100644 index 421d34a5509f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ServingConfigService - # Path helper methods for the ServingConfigService API. - module Paths - ## - # Create a fully-qualified ServingConfig resource string. - # - # @overload serving_config_path(project:, location:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, data_store:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param serving_config [String] - # - # @overload serving_config_path(project:, location:, collection:, engine:, serving_config:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param serving_config [String] - # - # @return [::String] - def serving_config_path **args - resources = { - "data_store:location:project:serving_config" => (proc do |project:, location:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}" - end), - "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb deleted file mode 100644 index ec6523375801..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/serving_config_service/credentials" -require "google/cloud/discovery_engine/v1/serving_config_service/paths" -require "google/cloud/discovery_engine/v1/serving_config_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for operations related to - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/serving_config_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new - # - module ServingConfigService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/serving_config_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb deleted file mode 100644 index 7cae7ef5eb03..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb +++ /dev/null @@ -1,451 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/serving_config_service_pb" -require "google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ServingConfigService - module Rest - ## - # REST client for the ServingConfigService service. - # - # Service for operations related to - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :serving_config_service_stub - - ## - # Configure the ServingConfigService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ServingConfigService clients - # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ServingConfigService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @serving_config_service_stub.universe_domain - end - - ## - # Create a new ServingConfigService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ServingConfigService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @serving_config_service_stub = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @serving_config_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @serving_config_service_stub.endpoint - config.universe_domain = @serving_config_service_stub.universe_domain - config.logger = @serving_config_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @serving_config_service_stub.logger - end - - # Service calls - - ## - # Updates a ServingConfig. - # - # Returns a NOT_FOUND error if the ServingConfig does not exist. - # - # @overload update_serving_config(request, options = nil) - # Pass arguments to `update_serving_config` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_serving_config(serving_config: nil, update_mask: nil) - # Pass arguments to `update_serving_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param serving_config [::Google::Cloud::DiscoveryEngine::V1::ServingConfig, ::Hash] - # Required. The ServingConfig to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. - # The following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new - # - # # Call the update_serving_config method. - # result = client.update_serving_config request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. - # p result - # - def update_serving_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_serving_config.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_serving_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @serving_config_service_stub.update_serving_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ServingConfigService REST API. - # - # This class represents the configuration for ServingConfigService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # update_serving_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.update_serving_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.update_serving_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ServingConfigService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `update_serving_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_serving_config - - # @private - def initialize parent_rpcs = nil - update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config - @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb deleted file mode 100644 index f05240911288..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/serving_config_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ServingConfigService - module Rest - ## - # REST service stub for the ServingConfigService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the update_serving_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # A result object deserialized from the server's reply - def update_serving_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_serving_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_serving_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the update_serving_config REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_serving_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{serving_config.name}", - body: "serving_config", - matches: [ - ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{serving_config.name}", - body: "serving_config", - matches: [ - ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{serving_config.name}", - body: "serving_config", - matches: [ - ["serving_config.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb deleted file mode 100644 index b58f2537bba9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/session_service/credentials" -require "google/cloud/discovery_engine/v1/session_service/paths" -require "google/cloud/discovery_engine/v1/session_service/client" -require "google/cloud/discovery_engine/v1/session_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Sessions and Session-related resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/session_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/session_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - module SessionService - end - end - end - end -end - -helper_path = ::File.join __dir__, "session_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/session_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb deleted file mode 100644 index 78a237f2e1d7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/client.rb +++ /dev/null @@ -1,937 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/session_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - ## - # Client for the SessionService service. - # - # Service for managing Sessions and Session-related resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_service_stub - - ## - # Configure the SessionService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionService clients - # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_service_stub.universe_domain - end - - ## - # Create a new SessionService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/session_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @session_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @session_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_service_stub.endpoint - config.universe_domain = @session_service_stub.universe_domain - config.logger = @session_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @session_service_stub.logger - end - - # Service calls - - ## - # Creates a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session(parent: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The session to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.call_rpc :create_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.call_rpc :delete_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Session. - # - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_session(request, options = nil) - # Pass arguments to `update_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_session(session: nil, update_mask: nil) - # Pass arguments to `update_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The Session to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} - # - # If not set or empty, all supported fields are updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - # - # # Call the update_session method. - # result = client.update_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def update_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session&.name - header_params["session.name"] = request.session.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.call_rpc :update_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session(name: nil, include_answer_details: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @param include_answer_details [::Boolean] - # Optional. If set to true, the full session including all answer details - # will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.call_rpc :get_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Sessions by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSessions` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A comma-separated list of fields to filter by, in EBNF grammar. - # The supported fields are: - # * `user_pseudo_id` - # * `state` - # * `display_name` - # * `starred` - # * `is_pinned` - # * `labels` - # * `create_time` - # * `update_time` - # - # Examples: - # "user_pseudo_id = some_id" - # "display_name = \"some_name\"" - # "starred = true" - # "is_pinned=true AND (NOT labels:hidden)" - # "create_time > \"1970-01-01T12:00:00Z\"" - # @param order_by [::String] - # 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` - # * `session_name` - # * `is_pinned` - # - # Example: - # - # * "update_time desc" - # * "create_time" - # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then - # by update_time. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.call_rpc :list_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @session_service_stub, :list_sessions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionService API. - # - # This class represents the configuration for SessionService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SessionService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `update_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session - @update_session = ::Gapic::Config::Method.new update_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb deleted file mode 100644 index 7ca5eca51bc3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - # Credentials for the SessionService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb deleted file mode 100644 index ebbab8b29f88..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/paths.rb +++ /dev/null @@ -1,355 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - # Path helper methods for the SessionService API. - module Paths - ## - # Create a fully-qualified Answer resource string. - # - # @overload answer_path(project:, location:, data_store:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # @param answer [String] - # - # @overload answer_path(project:, location:, collection:, data_store:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # @param answer [String] - # - # @overload answer_path(project:, location:, collection:, engine:, session:, answer:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # @param answer [String] - # - # @return [::String] - def answer_path **args - resources = { - "answer:data_store:location:project:session" => (proc do |project:, location:, data_store:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" - end), - "answer:collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}/answers/#{answer}" - end), - "answer:collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:, answer:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/answers/#{answer}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified AssistAnswer resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # @param assist_answer [String] - # - # @return [::String] - def assist_answer_path project:, location:, collection:, engine:, session:, assist_answer: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}/assistAnswers/#{assist_answer}" - end - - ## - # Create a fully-qualified Chunk resource string. - # - # @overload chunk_path(project:, location:, data_store:, branch:, document:, chunk:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # @param chunk [String] - # - # @overload chunk_path(project:, location:, collection:, data_store:, branch:, document:, chunk:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # @param chunk [String] - # - # @return [::String] - def chunk_path **args - resources = { - "branch:chunk:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:, chunk:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" - end), - "branch:chunk:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:, chunk:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - raise ::ArgumentError, "document cannot contain /" if document.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}/chunks/#{chunk}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, location:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, data_store:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param session [String] - # - # @overload session_path(project:, location:, collection:, engine:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "data_store:location:project:session" => (proc do |project:, location:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:data_store:location:project:session" => (proc do |project:, location:, collection:, data_store:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/sessions/#{session}" - end), - "collection:engine:location:project:session" => (proc do |project:, location:, collection:, engine:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/sessions/#{session}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb deleted file mode 100644 index 3422d8a2ed02..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/session_service/credentials" -require "google/cloud/discovery_engine/v1/session_service/paths" -require "google/cloud/discovery_engine/v1/session_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing Sessions and Session-related resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/session_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - module SessionService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/session_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb deleted file mode 100644 index fc2cc4684e05..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/client.rb +++ /dev/null @@ -1,859 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/session_service_pb" -require "google/cloud/discovery_engine/v1/session_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - module Rest - ## - # REST client for the SessionService service. - # - # Service for managing Sessions and Session-related resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_service_stub - - ## - # Configure the SessionService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionService clients - # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_service_stub.universe_domain - end - - ## - # Create a new SessionService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @session_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @session_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_service_stub.endpoint - config.universe_domain = @session_service_stub.universe_domain - config.logger = @session_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @session_service_stub.logger - end - - # Service calls - - ## - # Creates a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already - # exists, an ALREADY_EXISTS error is returned. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_session(parent: nil, session: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The session to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.create_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a Session. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does - # not exist, a NOT_FOUND error is returned. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_session(name: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.delete_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a Session. - # - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be - # changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to - # update does not exist, a NOT_FOUND error is returned. - # - # @overload update_session(request, options = nil) - # Pass arguments to `update_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_session(session: nil, update_mask: nil) - # Pass arguments to `update_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash] - # Required. The Session to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} - # - # If not set or empty, all supported fields are updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - # - # # Call the update_session method. - # result = client.update_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def update_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.update_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_session(name: nil, include_answer_details: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the Session to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @param include_answer_details [::Boolean] - # Optional. If set to true, the full session including all answer details - # will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.get_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Sessions by their parent - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @param page_size [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSessions` call. - # Provide this to retrieve the subsequent page. - # @param filter [::String] - # A comma-separated list of fields to filter by, in EBNF grammar. - # The supported fields are: - # * `user_pseudo_id` - # * `state` - # * `display_name` - # * `starred` - # * `is_pinned` - # * `labels` - # * `create_time` - # * `update_time` - # - # Examples: - # "user_pseudo_id = some_id" - # "display_name = \"some_name\"" - # "starred = true" - # "is_pinned=true AND (NOT labels:hidden)" - # "create_time > \"1970-01-01T12:00:00Z\"" - # @param order_by [::String] - # 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` - # * `session_name` - # * `is_pinned` - # - # Example: - # - # * "update_time desc" - # * "create_time" - # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then - # by update_time. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_service_stub.list_sessions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @session_service_stub, :list_sessions, "sessions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionService REST API. - # - # This class represents the configuration for SessionService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SessionService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - ## - # RPC-specific configuration for `update_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session - @update_session = ::Gapic::Config::Method.new update_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb deleted file mode 100644 index 65acba2903f7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/session_service/rest/service_stub.rb +++ /dev/null @@ -1,462 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/session_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - module Rest - ## - # REST service stub for the SessionService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def create_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def update_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # A result object deserialized from the server's reply - def get_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::Session.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse] - # A result object deserialized from the server's reply - def list_sessions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_sessions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session.name}", - body: "session", - matches: [ - ["session.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_session REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_sessions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb deleted file mode 100644 index 9e7d27415d8d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/site_search_engine_service/credentials" -require "google/cloud/discovery_engine/v1/site_search_engine_service/paths" -require "google/cloud/discovery_engine/v1/site_search_engine_service/operations" -require "google/cloud/discovery_engine/v1/site_search_engine_service/client" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing site search related resources. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/site_search_engine_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - module SiteSearchEngineService - end - end - end - end -end - -helper_path = ::File.join __dir__, "site_search_engine_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/site_search_engine_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb deleted file mode 100644 index ef25704d42b5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +++ /dev/null @@ -1,2012 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - ## - # Client for the SiteSearchEngineService service. - # - # Service for managing site search related resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :site_search_engine_service_stub - - ## - # Configure the SiteSearchEngineService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SiteSearchEngineService clients - # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SiteSearchEngineService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @site_search_engine_service_stub.universe_domain - end - - ## - # Create a new SiteSearchEngineService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SiteSearchEngineService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/site_search_engine_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @site_search_engine_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @site_search_engine_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @site_search_engine_service_stub.endpoint - config.universe_domain = @site_search_engine_service_stub.universe_domain - config.logger = @site_search_engine_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @site_search_engine_service_stub.logger - end - - # Service calls - - ## - # Gets the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}. - # - # @overload get_site_search_engine(request, options = nil) - # Pass arguments to `get_site_search_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_site_search_engine(name: nil) - # Pass arguments to `get_site_search_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to access the [SiteSearchEngine], - # regardless of whether or not it exists, a PERMISSION_DENIED error is - # returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new - # - # # Call the get_site_search_engine method. - # result = client.get_site_search_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. - # p result - # - def get_site_search_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_site_search_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_site_search_engine.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_site_search_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :get_site_search_engine, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload create_target_site(request, options = nil) - # Pass arguments to `create_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_target_site(parent: nil, target_site: nil) - # Pass arguments to `create_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to - # create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new - # - # # Call the create_target_site method. - # result = client.create_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_target_site.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :create_target_site, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in a - # batch. - # - # @overload batch_create_target_sites(request, options = nil) - # Pass arguments to `batch_create_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_target_sites(parent: nil, requests: nil) - # Pass arguments to `batch_create_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource shared by all TargetSites being created. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # The parent field in the CreateBookRequest messages must either be empty or - # match this field. - # @param requests [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash>] - # Required. The request message specifying the resources to create. - # A maximum of 20 TargetSites can be created in a batch. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new - # - # # Call the batch_create_target_sites method. - # result = client.batch_create_target_sites request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_create_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_create_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_create_target_sites.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :batch_create_target_sites, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload get_target_site(request, options = nil) - # Pass arguments to `get_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_target_site(name: nil) - # Pass arguments to `get_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new - # - # # Call the get_target_site method. - # result = client.get_target_site request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p result - # - def get_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_target_site.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :get_target_site, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload update_target_site(request, options = nil) - # Pass arguments to `update_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_target_site(target_site: nil) - # Pass arguments to `update_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] - # Required. The target site to update. - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update - # does not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new - # - # # Call the update_target_site method. - # result = client.update_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.target_site&.name - header_params["target_site.name"] = request.target_site.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_target_site.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :update_target_site, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload delete_target_site(request, options = nil) - # Pass arguments to `delete_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_target_site(name: nil) - # Pass arguments to `delete_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new - # - # # Call the delete_target_site method. - # result = client.delete_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_target_site.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :delete_target_site, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s. - # - # @overload list_target_sites(request, options = nil) - # Pass arguments to `list_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_target_sites(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent site search engine resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site - # search engine, regardless of whether or not this branch exists, a - # PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token, received from a previous `ListTargetSites` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargetSites` - # must match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new - # - # # Call the list_target_sites method. - # result = client.list_target_sites request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p item - # end - # - def list_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_target_sites.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :list_target_sites, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :list_target_sites, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. - # - # @overload create_sitemap(request, options = nil) - # Pass arguments to `create_sitemap` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_sitemap(parent: nil, sitemap: nil) - # Pass arguments to `create_sitemap` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param sitemap [::Google::Cloud::DiscoveryEngine::V1::Sitemap, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new - # - # # Call the create_sitemap method. - # result = client.create_sitemap request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_sitemap request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_sitemap.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_sitemap.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_sitemap.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :create_sitemap, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. - # - # @overload delete_sitemap(request, options = nil) - # Pass arguments to `delete_sitemap` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_sitemap(name: nil) - # Pass arguments to `delete_sitemap` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does - # not exist, a NOT_FOUND error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new - # - # # Call the delete_sitemap method. - # result = client.delete_sitemap request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_sitemap request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_sitemap.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_sitemap.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_sitemap.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :delete_sitemap, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fetch {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in a - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload fetch_sitemaps(request, options = nil) - # Pass arguments to `fetch_sitemaps` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_sitemaps(parent: nil, matcher: nil) - # Pass arguments to `fetch_sitemaps` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param matcher [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher, ::Hash] - # Optional. If specified, fetches the matching - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, - # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new - # - # # Call the fetch_sitemaps method. - # result = client.fetch_sitemaps request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. - # p result - # - def fetch_sitemaps request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.fetch_sitemaps.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.fetch_sitemaps.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_sitemaps.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :fetch_sitemaps, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Upgrade from basic site search to advanced site search. - # - # @overload enable_advanced_site_search(request, options = nil) - # Pass arguments to `enable_advanced_site_search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload enable_advanced_site_search(site_search_engine: nil) - # Pass arguments to `enable_advanced_site_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new - # - # # Call the enable_advanced_site_search method. - # result = client.enable_advanced_site_search request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_advanced_site_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.enable_advanced_site_search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.site_search_engine - header_params["site_search_engine"] = request.site_search_engine - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_advanced_site_search.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_advanced_site_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :enable_advanced_site_search, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Downgrade from advanced site search to basic site search. - # - # @overload disable_advanced_site_search(request, options = nil) - # Pass arguments to `disable_advanced_site_search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload disable_advanced_site_search(site_search_engine: nil) - # Pass arguments to `disable_advanced_site_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new - # - # # Call the disable_advanced_site_search method. - # result = client.disable_advanced_site_search request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_advanced_site_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.disable_advanced_site_search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.site_search_engine - header_params["site_search_engine"] = request.site_search_engine - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_advanced_site_search.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_advanced_site_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :disable_advanced_site_search, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Request on-demand recrawl for a list of URIs. - # - # @overload recrawl_uris(request, options = nil) - # Pass arguments to `recrawl_uris` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload recrawl_uris(site_search_engine: nil, uris: nil, site_credential: nil) - # Pass arguments to `recrawl_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param uris [::Array<::String>] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in - # `site_search_engine`. - # @param site_credential [::String] - # Optional. Credential id to use for crawling. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new - # - # # Call the recrawl_uris method. - # result = client.recrawl_uris request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def recrawl_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.recrawl_uris.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.site_search_engine - header_params["site_search_engine"] = request.site_search_engine - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.recrawl_uris.timeout, - metadata: metadata, - retry_policy: @config.rpcs.recrawl_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :recrawl_uris, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verify target sites' ownership and validity. - # This API sends all the target sites under site search engine for - # verification. - # - # @overload batch_verify_target_sites(request, options = nil) - # Pass arguments to `batch_verify_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_verify_target_sites(parent: nil) - # Pass arguments to `batch_verify_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource shared by all TargetSites being verified. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new - # - # # Call the batch_verify_target_sites method. - # result = client.batch_verify_target_sites request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_verify_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_verify_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_verify_target_sites.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_verify_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :batch_verify_target_sites, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns list of target sites with its domain verification status. - # This method can only be called under data store with BASIC_SITE_SEARCH - # state at the moment. - # - # @overload fetch_domain_verification_status(request, options = nil) - # Pass arguments to `fetch_domain_verification_status` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_domain_verification_status(site_search_engine: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_domain_verification_status` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. The site search engine resource under which we fetch all the - # domain verification status. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token, received from a previous `FetchDomainVerificationStatus` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `FetchDomainVerificationStatus` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new - # - # # Call the fetch_domain_verification_status method. - # result = client.fetch_domain_verification_status request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p item - # end - # - def fetch_domain_verification_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.fetch_domain_verification_status.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.site_search_engine - header_params["site_search_engine"] = request.site_search_engine - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.fetch_domain_verification_status.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_domain_verification_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.call_rpc :fetch_domain_verification_status, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @site_search_engine_service_stub, :fetch_domain_verification_status, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SiteSearchEngineService API. - # - # This class represents the configuration for SiteSearchEngineService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_site_search_engine to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_site_search_engine.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_site_search_engine.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SiteSearchEngineService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_site_search_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :get_site_search_engine - ## - # RPC-specific configuration for `create_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :create_target_site - ## - # RPC-specific configuration for `batch_create_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_target_sites - ## - # RPC-specific configuration for `get_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :get_target_site - ## - # RPC-specific configuration for `update_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :update_target_site - ## - # RPC-specific configuration for `delete_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_target_site - ## - # RPC-specific configuration for `list_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :list_target_sites - ## - # RPC-specific configuration for `create_sitemap` - # @return [::Gapic::Config::Method] - # - attr_reader :create_sitemap - ## - # RPC-specific configuration for `delete_sitemap` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_sitemap - ## - # RPC-specific configuration for `fetch_sitemaps` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_sitemaps - ## - # RPC-specific configuration for `enable_advanced_site_search` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_advanced_site_search - ## - # RPC-specific configuration for `disable_advanced_site_search` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_advanced_site_search - ## - # RPC-specific configuration for `recrawl_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :recrawl_uris - ## - # RPC-specific configuration for `batch_verify_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_verify_target_sites - ## - # RPC-specific configuration for `fetch_domain_verification_status` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_domain_verification_status - - # @private - def initialize parent_rpcs = nil - get_site_search_engine_config = parent_rpcs.get_site_search_engine if parent_rpcs.respond_to? :get_site_search_engine - @get_site_search_engine = ::Gapic::Config::Method.new get_site_search_engine_config - create_target_site_config = parent_rpcs.create_target_site if parent_rpcs.respond_to? :create_target_site - @create_target_site = ::Gapic::Config::Method.new create_target_site_config - batch_create_target_sites_config = parent_rpcs.batch_create_target_sites if parent_rpcs.respond_to? :batch_create_target_sites - @batch_create_target_sites = ::Gapic::Config::Method.new batch_create_target_sites_config - get_target_site_config = parent_rpcs.get_target_site if parent_rpcs.respond_to? :get_target_site - @get_target_site = ::Gapic::Config::Method.new get_target_site_config - update_target_site_config = parent_rpcs.update_target_site if parent_rpcs.respond_to? :update_target_site - @update_target_site = ::Gapic::Config::Method.new update_target_site_config - delete_target_site_config = parent_rpcs.delete_target_site if parent_rpcs.respond_to? :delete_target_site - @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config - list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites - @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config - create_sitemap_config = parent_rpcs.create_sitemap if parent_rpcs.respond_to? :create_sitemap - @create_sitemap = ::Gapic::Config::Method.new create_sitemap_config - delete_sitemap_config = parent_rpcs.delete_sitemap if parent_rpcs.respond_to? :delete_sitemap - @delete_sitemap = ::Gapic::Config::Method.new delete_sitemap_config - fetch_sitemaps_config = parent_rpcs.fetch_sitemaps if parent_rpcs.respond_to? :fetch_sitemaps - @fetch_sitemaps = ::Gapic::Config::Method.new fetch_sitemaps_config - enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search - @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config - disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search - @disable_advanced_site_search = ::Gapic::Config::Method.new disable_advanced_site_search_config - recrawl_uris_config = parent_rpcs.recrawl_uris if parent_rpcs.respond_to? :recrawl_uris - @recrawl_uris = ::Gapic::Config::Method.new recrawl_uris_config - batch_verify_target_sites_config = parent_rpcs.batch_verify_target_sites if parent_rpcs.respond_to? :batch_verify_target_sites - @batch_verify_target_sites = ::Gapic::Config::Method.new batch_verify_target_sites_config - fetch_domain_verification_status_config = parent_rpcs.fetch_domain_verification_status if parent_rpcs.respond_to? :fetch_domain_verification_status - @fetch_domain_verification_status = ::Gapic::Config::Method.new fetch_domain_verification_status_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb deleted file mode 100644 index 47f5e77408cf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - # Credentials for the SiteSearchEngineService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb deleted file mode 100644 index 28ea9d723c43..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SiteSearchEngineService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SiteSearchEngineService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb deleted file mode 100644 index 23cea989d014..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb +++ /dev/null @@ -1,176 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - # Path helper methods for the SiteSearchEngineService API. - module Paths - ## - # Create a fully-qualified SiteSearchEngine resource string. - # - # @overload site_search_engine_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload site_search_engine_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def site_search_engine_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Sitemap resource string. - # - # @overload sitemap_path(project:, location:, data_store:, sitemap:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param sitemap [String] - # - # @overload sitemap_path(project:, location:, collection:, data_store:, sitemap:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param sitemap [String] - # - # @return [::String] - def sitemap_path **args - resources = { - "data_store:location:project:sitemap" => (proc do |project:, location:, data_store:, sitemap:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}" - end), - "collection:data_store:location:project:sitemap" => (proc do |project:, location:, collection:, data_store:, sitemap:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified TargetSite resource string. - # - # @overload target_site_path(project:, location:, data_store:, target_site:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param target_site [String] - # - # @overload target_site_path(project:, location:, collection:, data_store:, target_site:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param target_site [String] - # - # @return [::String] - def target_site_path **args - resources = { - "data_store:location:project:target_site" => (proc do |project:, location:, data_store:, target_site:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine/targetSites/#{target_site}" - end), - "collection:data_store:location:project:target_site" => (proc do |project:, location:, collection:, data_store:, target_site:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine/targetSites/#{target_site}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb deleted file mode 100644 index 5e9d7aa6ba36..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/site_search_engine_service/credentials" -require "google/cloud/discovery_engine/v1/site_search_engine_service/paths" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing site search related resources. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - module SiteSearchEngineService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb deleted file mode 100644 index 5f426936c5f2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +++ /dev/null @@ -1,1864 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - module Rest - ## - # REST client for the SiteSearchEngineService service. - # - # Service for managing site search related resources. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :site_search_engine_service_stub - - ## - # Configure the SiteSearchEngineService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SiteSearchEngineService clients - # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SiteSearchEngineService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @site_search_engine_service_stub.universe_domain - end - - ## - # Create a new SiteSearchEngineService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SiteSearchEngineService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @site_search_engine_service_stub = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @site_search_engine_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @site_search_engine_service_stub.endpoint - config.universe_domain = @site_search_engine_service_stub.universe_domain - config.logger = @site_search_engine_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @site_search_engine_service_stub.logger - end - - # Service calls - - ## - # Gets the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}. - # - # @overload get_site_search_engine(request, options = nil) - # Pass arguments to `get_site_search_engine` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_site_search_engine(name: nil) - # Pass arguments to `get_site_search_engine` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to access the [SiteSearchEngine], - # regardless of whether or not it exists, a PERMISSION_DENIED error is - # returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new - # - # # Call the get_site_search_engine method. - # result = client.get_site_search_engine request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. - # p result - # - def get_site_search_engine request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_site_search_engine.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_site_search_engine.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_site_search_engine.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.get_site_search_engine request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload create_target_site(request, options = nil) - # Pass arguments to `create_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_target_site(parent: nil, target_site: nil) - # Pass arguments to `create_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to - # create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new - # - # # Call the create_target_site method. - # result = client.create_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_target_site.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.create_target_site request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in a - # batch. - # - # @overload batch_create_target_sites(request, options = nil) - # Pass arguments to `batch_create_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_target_sites(parent: nil, requests: nil) - # Pass arguments to `batch_create_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource shared by all TargetSites being created. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # The parent field in the CreateBookRequest messages must either be empty or - # match this field. - # @param requests [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Hash>] - # Required. The request message specifying the resources to create. - # A maximum of 20 TargetSites can be created in a batch. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new - # - # # Call the batch_create_target_sites method. - # result = client.batch_create_target_sites request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_create_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_create_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_create_target_sites.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.batch_create_target_sites request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload get_target_site(request, options = nil) - # Pass arguments to `get_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_target_site(name: nil) - # Pass arguments to `get_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new - # - # # Call the get_target_site method. - # result = client.get_target_site request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p result - # - def get_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_target_site.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.get_target_site request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload update_target_site(request, options = nil) - # Pass arguments to `update_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_target_site(target_site: nil) - # Pass arguments to `update_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param target_site [::Google::Cloud::DiscoveryEngine::V1::TargetSite, ::Hash] - # Required. The target site to update. - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update - # does not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new - # - # # Call the update_target_site method. - # result = client.update_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_target_site.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.update_target_site request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - # - # @overload delete_target_site(request, options = nil) - # Pass arguments to `delete_target_site` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_target_site(name: nil) - # Pass arguments to `delete_target_site` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new - # - # # Call the delete_target_site method. - # result = client.delete_target_site request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_target_site request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_target_site.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_target_site.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_target_site.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.delete_target_site request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a list of {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s. - # - # @overload list_target_sites(request, options = nil) - # Pass arguments to `list_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_target_sites(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent site search engine resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site - # search engine, regardless of whether or not this branch exists, a - # PERMISSION_DENIED error is returned. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token, received from a previous `ListTargetSites` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargetSites` - # must match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new - # - # # Call the list_target_sites method. - # result = client.list_target_sites request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p item - # end - # - def list_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_target_sites.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.list_target_sites request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @site_search_engine_service_stub, :list_target_sites, "target_sites", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. - # - # @overload create_sitemap(request, options = nil) - # Pass arguments to `create_sitemap` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_sitemap(parent: nil, sitemap: nil) - # Pass arguments to `create_sitemap` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param sitemap [::Google::Cloud::DiscoveryEngine::V1::Sitemap, ::Hash] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new - # - # # Call the create_sitemap method. - # result = client.create_sitemap request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_sitemap request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_sitemap.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_sitemap.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_sitemap.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.create_sitemap request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. - # - # @overload delete_sitemap(request, options = nil) - # Pass arguments to `delete_sitemap` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_sitemap(name: nil) - # Pass arguments to `delete_sitemap` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does - # not exist, a NOT_FOUND error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new - # - # # Call the delete_sitemap method. - # result = client.delete_sitemap request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_sitemap request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_sitemap.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_sitemap.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_sitemap.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.delete_sitemap request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Fetch {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in a - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # - # @overload fetch_sitemaps(request, options = nil) - # Pass arguments to `fetch_sitemaps` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_sitemaps(parent: nil, matcher: nil) - # Pass arguments to `fetch_sitemaps` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param matcher [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher, ::Hash] - # Optional. If specified, fetches the matching - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, - # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new - # - # # Call the fetch_sitemaps method. - # result = client.fetch_sitemaps request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. - # p result - # - def fetch_sitemaps request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.fetch_sitemaps.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_sitemaps.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_sitemaps.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.fetch_sitemaps request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Upgrade from basic site search to advanced site search. - # - # @overload enable_advanced_site_search(request, options = nil) - # Pass arguments to `enable_advanced_site_search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload enable_advanced_site_search(site_search_engine: nil) - # Pass arguments to `enable_advanced_site_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new - # - # # Call the enable_advanced_site_search method. - # result = client.enable_advanced_site_search request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def enable_advanced_site_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.enable_advanced_site_search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_advanced_site_search.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_advanced_site_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.enable_advanced_site_search request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Downgrade from advanced site search to basic site search. - # - # @overload disable_advanced_site_search(request, options = nil) - # Pass arguments to `disable_advanced_site_search` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload disable_advanced_site_search(site_search_engine: nil) - # Pass arguments to `disable_advanced_site_search` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new - # - # # Call the disable_advanced_site_search method. - # result = client.disable_advanced_site_search request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def disable_advanced_site_search request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.disable_advanced_site_search.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_advanced_site_search.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_advanced_site_search.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.disable_advanced_site_search request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Request on-demand recrawl for a list of URIs. - # - # @overload recrawl_uris(request, options = nil) - # Pass arguments to `recrawl_uris` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload recrawl_uris(site_search_engine: nil, uris: nil, site_credential: nil) - # Pass arguments to `recrawl_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @param uris [::Array<::String>] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in - # `site_search_engine`. - # @param site_credential [::String] - # Optional. Credential id to use for crawling. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new - # - # # Call the recrawl_uris method. - # result = client.recrawl_uris request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def recrawl_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.recrawl_uris.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.recrawl_uris.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.recrawl_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.recrawl_uris request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Verify target sites' ownership and validity. - # This API sends all the target sites under site search engine for - # verification. - # - # @overload batch_verify_target_sites(request, options = nil) - # Pass arguments to `batch_verify_target_sites` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_verify_target_sites(parent: nil) - # Pass arguments to `batch_verify_target_sites` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource shared by all TargetSites being verified. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new - # - # # Call the batch_verify_target_sites method. - # result = client.batch_verify_target_sites request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_verify_target_sites request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_verify_target_sites.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_verify_target_sites.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_verify_target_sites.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.batch_verify_target_sites request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns list of target sites with its domain verification status. - # This method can only be called under data store with BASIC_SITE_SEARCH - # state at the moment. - # - # @overload fetch_domain_verification_status(request, options = nil) - # Pass arguments to `fetch_domain_verification_status` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_domain_verification_status(site_search_engine: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_domain_verification_status` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param site_search_engine [::String] - # Required. The site search engine resource under which we fetch all the - # domain verification status. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # A page token, received from a previous `FetchDomainVerificationStatus` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `FetchDomainVerificationStatus` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new - # - # # Call the fetch_domain_verification_status method. - # result = client.fetch_domain_verification_status request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - # p item - # end - # - def fetch_domain_verification_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.fetch_domain_verification_status.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.fetch_domain_verification_status.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_domain_verification_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @site_search_engine_service_stub.fetch_domain_verification_status request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @site_search_engine_service_stub, :fetch_domain_verification_status, "target_sites", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SiteSearchEngineService REST API. - # - # This class represents the configuration for SiteSearchEngineService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # get_site_search_engine to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_site_search_engine.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_site_search_engine.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SiteSearchEngineService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_site_search_engine` - # @return [::Gapic::Config::Method] - # - attr_reader :get_site_search_engine - ## - # RPC-specific configuration for `create_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :create_target_site - ## - # RPC-specific configuration for `batch_create_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_target_sites - ## - # RPC-specific configuration for `get_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :get_target_site - ## - # RPC-specific configuration for `update_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :update_target_site - ## - # RPC-specific configuration for `delete_target_site` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_target_site - ## - # RPC-specific configuration for `list_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :list_target_sites - ## - # RPC-specific configuration for `create_sitemap` - # @return [::Gapic::Config::Method] - # - attr_reader :create_sitemap - ## - # RPC-specific configuration for `delete_sitemap` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_sitemap - ## - # RPC-specific configuration for `fetch_sitemaps` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_sitemaps - ## - # RPC-specific configuration for `enable_advanced_site_search` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_advanced_site_search - ## - # RPC-specific configuration for `disable_advanced_site_search` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_advanced_site_search - ## - # RPC-specific configuration for `recrawl_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :recrawl_uris - ## - # RPC-specific configuration for `batch_verify_target_sites` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_verify_target_sites - ## - # RPC-specific configuration for `fetch_domain_verification_status` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_domain_verification_status - - # @private - def initialize parent_rpcs = nil - get_site_search_engine_config = parent_rpcs.get_site_search_engine if parent_rpcs.respond_to? :get_site_search_engine - @get_site_search_engine = ::Gapic::Config::Method.new get_site_search_engine_config - create_target_site_config = parent_rpcs.create_target_site if parent_rpcs.respond_to? :create_target_site - @create_target_site = ::Gapic::Config::Method.new create_target_site_config - batch_create_target_sites_config = parent_rpcs.batch_create_target_sites if parent_rpcs.respond_to? :batch_create_target_sites - @batch_create_target_sites = ::Gapic::Config::Method.new batch_create_target_sites_config - get_target_site_config = parent_rpcs.get_target_site if parent_rpcs.respond_to? :get_target_site - @get_target_site = ::Gapic::Config::Method.new get_target_site_config - update_target_site_config = parent_rpcs.update_target_site if parent_rpcs.respond_to? :update_target_site - @update_target_site = ::Gapic::Config::Method.new update_target_site_config - delete_target_site_config = parent_rpcs.delete_target_site if parent_rpcs.respond_to? :delete_target_site - @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config - list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites - @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config - create_sitemap_config = parent_rpcs.create_sitemap if parent_rpcs.respond_to? :create_sitemap - @create_sitemap = ::Gapic::Config::Method.new create_sitemap_config - delete_sitemap_config = parent_rpcs.delete_sitemap if parent_rpcs.respond_to? :delete_sitemap - @delete_sitemap = ::Gapic::Config::Method.new delete_sitemap_config - fetch_sitemaps_config = parent_rpcs.fetch_sitemaps if parent_rpcs.respond_to? :fetch_sitemaps - @fetch_sitemaps = ::Gapic::Config::Method.new fetch_sitemaps_config - enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search - @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config - disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search - @disable_advanced_site_search = ::Gapic::Config::Method.new disable_advanced_site_search_config - recrawl_uris_config = parent_rpcs.recrawl_uris if parent_rpcs.respond_to? :recrawl_uris - @recrawl_uris = ::Gapic::Config::Method.new recrawl_uris_config - batch_verify_target_sites_config = parent_rpcs.batch_verify_target_sites if parent_rpcs.respond_to? :batch_verify_target_sites - @batch_verify_target_sites = ::Gapic::Config::Method.new batch_verify_target_sites_config - fetch_domain_verification_status_config = parent_rpcs.fetch_domain_verification_status if parent_rpcs.respond_to? :fetch_domain_verification_status - @fetch_domain_verification_status = ::Gapic::Config::Method.new fetch_domain_verification_status_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb deleted file mode 100644 index 39d5ff1d3a5b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SiteSearchEngineService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SiteSearchEngineService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb deleted file mode 100644 index f6aadf6f56fc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +++ /dev/null @@ -1,1102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - module Rest - ## - # REST service stub for the SiteSearchEngineService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_site_search_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine] - # A result object deserialized from the server's reply - def get_site_search_engine request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_site_search_engine_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_site_search_engine", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_target_site request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_target_site_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_target_site", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_create_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_create_target_sites request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_target_sites_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_create_target_sites", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # A result object deserialized from the server's reply - def get_target_site request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_target_site_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_target_site", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_target_site request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_target_site_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_target_site", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_target_site request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_target_site_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_target_site", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse] - # A result object deserialized from the server's reply - def list_target_sites request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_target_sites_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_target_sites", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_sitemap REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_sitemap request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_sitemap_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_sitemap", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_sitemap REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_sitemap request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_sitemap_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_sitemap", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_sitemaps REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse] - # A result object deserialized from the server's reply - def fetch_sitemaps request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_sitemaps_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "fetch_sitemaps", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the enable_advanced_site_search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def enable_advanced_site_search request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_advanced_site_search_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "enable_advanced_site_search", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_advanced_site_search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def disable_advanced_site_search request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_advanced_site_search_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "disable_advanced_site_search", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the recrawl_uris REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def recrawl_uris request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_recrawl_uris_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "recrawl_uris", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_verify_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_verify_target_sites request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_verify_target_sites_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_verify_target_sites", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_domain_verification_status REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse] - # A result object deserialized from the server's reply - def fetch_domain_verification_status request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_domain_verification_status_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "fetch_domain_verification_status", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_site_search_engine REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_site_search_engine_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_target_site_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/targetSites", - body: "target_site", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/targetSites", - body: "target_site", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_target_sites_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/targetSites:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/targetSites:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_target_site_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_target_site_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{target_site.name}", - body: "target_site", - matches: [ - ["target_site.name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{target_site.name}", - body: "target_site", - matches: [ - ["target_site.name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_target_site REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_target_site_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_target_sites_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/targetSites", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/targetSites", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_sitemap REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_sitemap_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sitemaps", - body: "sitemap", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sitemaps", - body: "sitemap", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_sitemap REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_sitemap_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/sitemaps/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/sitemaps/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_sitemaps REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_sitemaps_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sitemaps:fetch", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sitemaps:fetch", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_advanced_site_search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_advanced_site_search_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:enableAdvancedSiteSearch", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:enableAdvancedSiteSearch", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_advanced_site_search REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_advanced_site_search_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:disableAdvancedSiteSearch", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:disableAdvancedSiteSearch", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the recrawl_uris REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_recrawl_uris_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:recrawlUris", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{site_search_engine}:recrawlUris", - body: "*", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_verify_target_sites REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_verify_target_sites_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:batchVerifyTargetSites", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_domain_verification_status REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_domain_verification_status_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{site_search_engine}:fetchDomainVerificationStatus", - matches: [ - ["site_search_engine", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb deleted file mode 100644 index 1e5b40576e42..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/user_event_service/credentials" -require "google/cloud/discovery_engine/v1/user_event_service/paths" -require "google/cloud/discovery_engine/v1/user_event_service/operations" -require "google/cloud/discovery_engine/v1/user_event_service/client" -require "google/cloud/discovery_engine/v1/user_event_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ingesting end user actions on a website to Discovery Engine API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/user_event_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/user_event_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - module UserEventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "user_event_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/user_event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb deleted file mode 100644 index f2b98a35366a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +++ /dev/null @@ -1,911 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/user_event_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - ## - # Client for the UserEventService service. - # - # Service for ingesting end user actions on a website to Discovery Engine API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.import_user_events.timeout = 300.0 - default_config.rpcs.import_user_events.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @user_event_service_stub.universe_domain - end - - ## - # Create a new UserEventService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserEventService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/user_event_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @user_event_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @user_event_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_event_service_stub.endpoint - config.universe_domain = @user_event_service_stub.universe_domain - config.logger = @user_event_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @user_event_service_stub.logger - end - - # Service calls - - ## - # Writes a single user event. - # - # @overload write_user_event(request, options = nil) - # Pass arguments to `write_user_event` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) - # Pass arguments to `write_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. - # If the write user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the write user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] - # Required. User event to write. - # @param write_async [::Boolean] - # If set to true, the user event is written asynchronously after - # validation, and the API responds without waiting for the write. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. - # p result - # - def write_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.write_user_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.write_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :write_user_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload collect_user_event(request, options = nil) - # Pass arguments to `collect_user_event` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload collect_user_event(parent: nil, user_event: nil, uri: nil, ets: nil) - # Pass arguments to `collect_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. - # If the collect user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the collect user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @param uri [::String] - # 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. - # @param ets [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Api::HttpBody] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Api::HttpBody] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new - # - # # Call the collect_user_event method. - # result = client.collect_user_event request - # - # # The returned object is of type Google::Api::HttpBody. - # p result - # - def collect_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.collect_user_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.collect_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :collect_user_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload purge_user_events(request, options = nil) - # Pass arguments to `purge_user_events` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_user_events(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. - # @param filter [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. - # - # Note: This API only supports purging a max range of 30 days. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` - # * Deleting all events for a specific visitor in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` - # * Deleting the past 30 days of events inside a DataStore: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new - # - # # Call the purge_user_events method. - # result = client.purge_user_events request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.purge_user_events.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :purge_user_events, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload import_user_events(request, options = nil) - # Pass arguments to `import_user_events` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_user_events(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) - # Pass arguments to `import_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource, ::Hash] - # The Inline source for the input content for UserEvents. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. Parent DataStore resource name, of the form - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new - # - # # Call the import_user_events method. - # result = client.import_user_events request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_user_events.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.call_rpc :import_user_events, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the UserEventService API. - # - # This class represents the configuration for UserEventService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # write_user_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the UserEventService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `write_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :write_user_event - ## - # RPC-specific configuration for `collect_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :collect_user_event - ## - # RPC-specific configuration for `purge_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_user_events - ## - # RPC-specific configuration for `import_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :import_user_events - - # @private - def initialize parent_rpcs = nil - write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event - @write_user_event = ::Gapic::Config::Method.new write_user_event_config - collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event - @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config - purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events - @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config - import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events - @import_user_events = ::Gapic::Config::Method.new import_user_events_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb deleted file mode 100644 index 5d45c78a49c0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - # Credentials for the UserEventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb deleted file mode 100644 index eb1e9e4321bc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserEventService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb deleted file mode 100644 index 43921115be39..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +++ /dev/null @@ -1,152 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - # Path helper methods for the UserEventService API. - module Paths - ## - # Create a fully-qualified DataStore resource string. - # - # @overload data_store_path(project:, location:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # - # @overload data_store_path(project:, location:, collection:, data_store:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # - # @return [::String] - def data_store_path **args - resources = { - "data_store:location:project" => (proc do |project:, location:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}" - end), - "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, location:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @overload document_path(project:, location:, collection:, data_store:, branch:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param data_store [String] - # @param branch [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "branch:data_store:document:location:project" => (proc do |project:, location:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end), - "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/" - raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Engine resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - # - # @param project [String] - # @param location [String] - # @param collection [String] - # @param engine [String] - # - # @return [::String] - def engine_path project:, location:, collection:, engine: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/" - - "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb deleted file mode 100644 index 8a5c39a51034..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/user_event_service/credentials" -require "google/cloud/discovery_engine/v1/user_event_service/paths" -require "google/cloud/discovery_engine/v1/user_event_service/rest/operations" -require "google/cloud/discovery_engine/v1/user_event_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for ingesting end user actions on a website to Discovery Engine API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/user_event_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - module UserEventService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/user_event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb deleted file mode 100644 index 8548401fae1e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +++ /dev/null @@ -1,840 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/user_event_service_pb" -require "google/cloud/discovery_engine/v1/user_event_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - module Rest - ## - # REST client for the UserEventService service. - # - # Service for ingesting end user actions on a website to Discovery Engine API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_event_service_stub - - ## - # Configure the UserEventService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserEventService clients - # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.timeout = 30.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.import_user_events.timeout = 300.0 - default_config.rpcs.import_user_events.retry_policy = { - initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @user_event_service_stub.universe_domain - end - - ## - # Create a new UserEventService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserEventService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @user_event_service_stub = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @user_event_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_event_service_stub.endpoint - config.universe_domain = @user_event_service_stub.universe_domain - config.logger = @user_event_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @user_event_service_stub.logger - end - - # Service calls - - ## - # Writes a single user event. - # - # @overload write_user_event(request, options = nil) - # Pass arguments to `write_user_event` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload write_user_event(parent: nil, user_event: nil, write_async: nil) - # Pass arguments to `write_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. - # If the write user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the write user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @param user_event [::Google::Cloud::DiscoveryEngine::V1::UserEvent, ::Hash] - # Required. User event to write. - # @param write_async [::Boolean] - # If set to true, the user event is written asynchronously after - # validation, and the API responds without waiting for the write. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new - # - # # Call the write_user_event method. - # result = client.write_user_event request - # - # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. - # p result - # - def write_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.write_user_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.write_user_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.write_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.write_user_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload collect_user_event(request, options = nil) - # Pass arguments to `collect_user_event` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload collect_user_event(parent: nil, user_event: nil, uri: nil, ets: nil) - # Pass arguments to `collect_user_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name. - # If the collect user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the collect user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @param user_event [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @param uri [::String] - # 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. - # @param ets [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Api::HttpBody] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::HttpBody] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new - # - # # Call the collect_user_event method. - # result = client.collect_user_event request - # - # # The returned object is of type Google::Api::HttpBody. - # p result - # - def collect_user_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.collect_user_event.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.collect_user_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.collect_user_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.collect_user_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload purge_user_events(request, options = nil) - # Pass arguments to `purge_user_events` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_user_events(parent: nil, filter: nil, force: nil) - # Pass arguments to `purge_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. - # @param filter [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. - # - # Note: This API only supports purging a max range of 30 days. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` - # * Deleting all events for a specific visitor in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` - # * Deleting the past 30 days of events inside a DataStore: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # @param force [::Boolean] - # 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new - # - # # Call the purge_user_events method. - # result = client.purge_user_events request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def purge_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.purge_user_events.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.purge_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.purge_user_events request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # 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. - # - # @overload import_user_events(request, options = nil) - # Pass arguments to `import_user_events` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_user_events(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) - # Pass arguments to `import_user_events` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource, ::Hash] - # The Inline source for the input content for UserEvents. - # - # Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1::GcsSource, ::Hash] - # Cloud Storage location for the input content. - # - # Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource, ::Hash] - # BigQuery input source. - # - # Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param parent [::String] - # Required. Parent DataStore resource name, of the form - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # @param error_config [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig, ::Hash] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new - # - # # Call the import_user_events method. - # result = client.import_user_events request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_user_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_user_events.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_user_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_user_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_event_service_stub.import_user_events request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the UserEventService REST API. - # - # This class represents the configuration for UserEventService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # write_user_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.write_user_event.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the UserEventService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `write_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :write_user_event - ## - # RPC-specific configuration for `collect_user_event` - # @return [::Gapic::Config::Method] - # - attr_reader :collect_user_event - ## - # RPC-specific configuration for `purge_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_user_events - ## - # RPC-specific configuration for `import_user_events` - # @return [::Gapic::Config::Method] - # - attr_reader :import_user_events - - # @private - def initialize parent_rpcs = nil - write_user_event_config = parent_rpcs.write_user_event if parent_rpcs.respond_to? :write_user_event - @write_user_event = ::Gapic::Config::Method.new write_user_event_config - collect_user_event_config = parent_rpcs.collect_user_event if parent_rpcs.respond_to? :collect_user_event - @collect_user_event = ::Gapic::Config::Method.new collect_user_event_config - purge_user_events_config = parent_rpcs.purge_user_events if parent_rpcs.respond_to? :purge_user_events - @purge_user_events = ::Gapic::Config::Method.new purge_user_events_config - import_user_events_config = parent_rpcs.import_user_events if parent_rpcs.respond_to? :import_user_events - @import_user_events = ::Gapic::Config::Method.new import_user_events_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb deleted file mode 100644 index 96b7418237d2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserEventService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the UserEventService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb deleted file mode 100644 index 9dc12fd6b9e8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +++ /dev/null @@ -1,382 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/user_event_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - module Rest - ## - # REST service stub for the UserEventService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the write_user_event REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # A result object deserialized from the server's reply - def write_user_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_write_user_event_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "write_user_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the collect_user_event REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Api::HttpBody] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Api::HttpBody] - # A result object deserialized from the server's reply - def collect_user_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_collect_user_event_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "collect_user_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Api::HttpBody.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_user_events REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def purge_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_user_events_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "purge_user_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_user_events REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_user_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_user_events_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_user_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the write_user_event REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_write_user_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:write", - body: "user_event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:write", - body: "user_event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:write", - body: "user_event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the collect_user_event REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_collect_user_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/userEvents:collect", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/userEvents:collect", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/userEvents:collect", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_user_events REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:purge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_user_events REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_user_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/userEvents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb deleted file mode 100644 index 552b1f212e4b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/user_license_service/credentials" -require "google/cloud/discovery_engine/v1/user_license_service/paths" -require "google/cloud/discovery_engine/v1/user_license_service/operations" -require "google/cloud/discovery_engine/v1/user_license_service/client" -require "google/cloud/discovery_engine/v1/user_license_service/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing User Licenses. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/discovery_engine/v1/user_license_service" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/discovery_engine/v1/user_license_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new - # - module UserLicenseService - end - end - end - end -end - -helper_path = ::File.join __dir__, "user_license_service", "helpers.rb" -require "google/cloud/discovery_engine/v1/user_license_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb deleted file mode 100644 index 9da049ab7849..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb +++ /dev/null @@ -1,647 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/user_license_service_pb" -require "google/cloud/location" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - ## - # Client for the UserLicenseService service. - # - # Service for managing User Licenses. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_license_service_stub - - ## - # Configure the UserLicenseService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserLicenseService clients - # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserLicenseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @user_license_service_stub.universe_domain - end - - ## - # Create a new UserLicenseService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserLicenseService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/discoveryengine/v1/user_license_service_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @user_license_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @user_license_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_license_service_stub.endpoint - config.universe_domain = @user_license_service_stub.universe_domain - config.logger = @user_license_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @user_license_service_stub.logger - end - - # Service calls - - ## - # Lists the User Licenses. - # - # @overload list_user_licenses(request, options = nil) - # Pass arguments to `list_user_licenses` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_user_licenses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, defaults to 10. The maximum value is 50; values - # above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListUserLicenses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUserLicenses` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. Filter for the list request. - # - # Supported fields: - # - # * `license_assignment_state` - # - # Examples: - # - # * `license_assignment_state = ASSIGNED` to list assigned user licenses. - # * `license_assignment_state = NO_LICENSE` to list not licensed users. - # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users - # who attempted login but no license assigned. - # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter - # out users who attempted login but no license assigned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new - # - # # Call the list_user_licenses method. - # result = client.list_user_licenses request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. - # p item - # end - # - def list_user_licenses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_user_licenses.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_user_licenses.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_user_licenses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_license_service_stub.call_rpc :list_user_licenses, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @user_license_service_stub, :list_user_licenses, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the User License. - # This method is used for batch assign/unassign licenses to users. - # - # @overload batch_update_user_licenses(request, options = nil) - # Pass arguments to `batch_update_user_licenses` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) - # Pass arguments to `batch_update_user_licenses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash] - # The inline source for the input content for document embeddings. - # @param parent [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @param delete_unassigned_user_licenses [::Boolean] - # Optional. If true, if user licenses removed associated license config, the - # user license will be deleted. By default which is false, the user license - # will be updated to unassigned state. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new - # - # # Call the batch_update_user_licenses method. - # result = client.batch_update_user_licenses request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_update_user_licenses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.batch_update_user_licenses.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.batch_update_user_licenses.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_user_licenses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_license_service_stub.call_rpc :batch_update_user_licenses, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the UserLicenseService API. - # - # This class represents the configuration for UserLicenseService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_user_licenses to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_user_licenses.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_user_licenses.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the UserLicenseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_user_licenses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_user_licenses - ## - # RPC-specific configuration for `batch_update_user_licenses` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_user_licenses - - # @private - def initialize parent_rpcs = nil - list_user_licenses_config = parent_rpcs.list_user_licenses if parent_rpcs.respond_to? :list_user_licenses - @list_user_licenses = ::Gapic::Config::Method.new list_user_licenses_config - batch_update_user_licenses_config = parent_rpcs.batch_update_user_licenses if parent_rpcs.respond_to? :batch_update_user_licenses - @batch_update_user_licenses = ::Gapic::Config::Method.new batch_update_user_licenses_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb deleted file mode 100644 index 5368c2b001d7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - # Credentials for the UserLicenseService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb deleted file mode 100644 index d88dba5040dc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserLicenseService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the UserLicenseService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb deleted file mode 100644 index cf87417d889e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - # Path helper methods for the UserLicenseService API. - module Paths - ## - # Create a fully-qualified LicenseConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/licenseConfigs/{license_config}` - # - # @param project [String] - # @param location [String] - # @param license_config [String] - # - # @return [::String] - def license_config_path project:, location:, license_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/licenseConfigs/#{license_config}" - end - - ## - # Create a fully-qualified UserStore resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/userStores/{user_store}` - # - # @param project [String] - # @param location [String] - # @param user_store [String] - # - # @return [::String] - def user_store_path project:, location:, user_store: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/userStores/#{user_store}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb deleted file mode 100644 index 9db035b4724f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/discovery_engine/v1/version" - -require "google/cloud/discovery_engine/v1/user_license_service/credentials" -require "google/cloud/discovery_engine/v1/user_license_service/paths" -require "google/cloud/discovery_engine/v1/user_license_service/rest/operations" -require "google/cloud/discovery_engine/v1/user_license_service/rest/client" - -module Google - module Cloud - module DiscoveryEngine - module V1 - ## - # Service for managing User Licenses. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/discovery_engine/v1/user_license_service/rest" - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new - # - module UserLicenseService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/discovery_engine/v1/user_license_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb deleted file mode 100644 index 30ffa801bcb8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb +++ /dev/null @@ -1,590 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/discoveryengine/v1/user_license_service_pb" -require "google/cloud/discovery_engine/v1/user_license_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - module Rest - ## - # REST client for the UserLicenseService service. - # - # Service for managing User Licenses. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :user_license_service_stub - - ## - # Configure the UserLicenseService Client class. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all UserLicenseService clients - # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the UserLicenseService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @user_license_service_stub.universe_domain - end - - ## - # Create a new UserLicenseService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the UserLicenseService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @user_license_service_stub = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @user_license_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @user_license_service_stub.endpoint - config.universe_domain = @user_license_service_stub.universe_domain - config.logger = @user_license_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @user_license_service_stub.logger - end - - # Service calls - - ## - # Lists the User Licenses. - # - # @overload list_user_licenses(request, options = nil) - # Pass arguments to `list_user_licenses` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_user_licenses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, defaults to 10. The maximum value is 50; values - # above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListUserLicenses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUserLicenses` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. Filter for the list request. - # - # Supported fields: - # - # * `license_assignment_state` - # - # Examples: - # - # * `license_assignment_state = ASSIGNED` to list assigned user licenses. - # * `license_assignment_state = NO_LICENSE` to list not licensed users. - # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users - # who attempted login but no license assigned. - # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter - # out users who attempted login but no license assigned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new - # - # # Call the list_user_licenses method. - # result = client.list_user_licenses request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. - # p item - # end - # - def list_user_licenses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_user_licenses.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_user_licenses.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_user_licenses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_license_service_stub.list_user_licenses request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @user_license_service_stub, :list_user_licenses, "user_licenses", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the User License. - # This method is used for batch assign/unassign licenses to users. - # - # @overload batch_update_user_licenses(request, options = nil) - # Pass arguments to `batch_update_user_licenses` via a request object, either of type - # {::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil) - # Pass arguments to `batch_update_user_licenses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash] - # The inline source for the input content for document embeddings. - # @param parent [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @param delete_unassigned_user_licenses [::Boolean] - # Optional. If true, if user licenses removed associated license config, the - # user license will be deleted. By default which is false, the user license - # will be updated to unassigned state. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/discovery_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new - # - # # Call the batch_update_user_licenses method. - # result = client.batch_update_user_licenses request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def batch_update_user_licenses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.batch_update_user_licenses.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.batch_update_user_licenses.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_user_licenses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @user_license_service_stub.batch_update_user_licenses request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the UserLicenseService REST API. - # - # This class represents the configuration for UserLicenseService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_user_licenses to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_user_licenses.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_user_licenses.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the UserLicenseService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_user_licenses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_user_licenses - ## - # RPC-specific configuration for `batch_update_user_licenses` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_user_licenses - - # @private - def initialize parent_rpcs = nil - list_user_licenses_config = parent_rpcs.list_user_licenses if parent_rpcs.respond_to? :list_user_licenses - @list_user_licenses = ::Gapic::Config::Method.new list_user_licenses_config - batch_update_user_licenses_config = parent_rpcs.batch_update_user_licenses if parent_rpcs.respond_to? :batch_update_user_licenses - @batch_update_user_licenses = ::Gapic::Config::Method.new batch_update_user_licenses_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb deleted file mode 100644 index f596f60966b2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb +++ /dev/null @@ -1,1159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the UserLicenseService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the UserLicenseService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "discoveryengine.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataConnector/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/schemas/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/siteSearchEngine/targetSites/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/models/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/identityMappingStores/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb deleted file mode 100644 index ffaf1edda4ef..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb +++ /dev/null @@ -1,204 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/discoveryengine/v1/user_license_service_pb" - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - module Rest - ## - # REST service stub for the UserLicenseService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_user_licenses REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse] - # A result object deserialized from the server's reply - def list_user_licenses request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_user_licenses_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_user_licenses", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_update_user_licenses REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def batch_update_user_licenses request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_user_licenses_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "batch_update_user_licenses", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_user_licenses REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_user_licenses_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/userLicenses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/userStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_user_licenses REST call - # - # @param request_pb [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_update_user_licenses_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:batchUpdateUserLicenses", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/userStores/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb deleted file mode 100644 index 8866f397154c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb deleted file mode 100644 index 75c21b8df255..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/answer_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/answer.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/safety_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/discoveryengine/v1/answer.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/safety.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\'\n\x06\x41nswer\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12<\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.Answer.State\x12\x13\n\x0b\x61nswer_text\x18\x03 \x01(\t\x12\x1c\n\x0fgrounding_score\x18\x0c \x01(\x01H\x00\x88\x01\x01\x12\x43\n\tcitations\x18\x04 \x03(\x0b\x32\x30.google.cloud.discoveryengine.v1.Answer.Citation\x12Y\n\x12grounding_supports\x18\r \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.Answer.GroundingSupportB\x03\xe0\x41\x01\x12\x45\n\nreferences\x18\x05 \x03(\x0b\x32\x31.google.cloud.discoveryengine.v1.Answer.Reference\x12\x19\n\x11related_questions\x18\x06 \x03(\t\x12;\n\x05steps\x18\x07 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.Answer.Step\x12`\n\x18query_understanding_info\x18\n \x01(\x0b\x32>.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo\x12[\n\x16\x61nswer_skipped_reasons\x18\x0b \x03(\x0e\x32;.google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\x0esafety_ratings\x18\x0e \x03(\x0b\x32-.google.cloud.discoveryengine.v1.SafetyRatingB\x03\xe0\x41\x01\x1a{\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12G\n\x07sources\x18\x03 \x03(\x0b\x32\x36.google.cloud.discoveryengine.v1.Answer.CitationSource\x1a&\n\x0e\x43itationSource\x12\x14\n\x0creference_id\x18\x01 \x01(\t\x1a\x88\x02\n\x10GroundingSupport\x12\x18\n\x0bstart_index\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\x12\x16\n\tend_index\x18\x02 \x01(\x03\x42\x03\xe0\x41\x02\x12\x1c\n\x0fgrounding_score\x18\x03 \x01(\x01H\x00\x88\x01\x01\x12%\n\x18grounding_check_required\x18\x04 \x01(\x08H\x01\x88\x01\x01\x12L\n\x07sources\x18\x05 \x03(\x0b\x32\x36.google.cloud.discoveryengine.v1.Answer.CitationSourceB\x03\xe0\x41\x01\x42\x12\n\x10_grounding_scoreB\x1b\n\x19_grounding_check_required\x1a\xa8\n\n\tReference\x12p\n\x1aunstructured_document_info\x18\x01 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfoH\x00\x12Q\n\nchunk_info\x18\x02 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfoH\x00\x12l\n\x18structured_document_info\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.Answer.Reference.StructuredDocumentInfoH\x00\x1a\x81\x03\n\x18UnstructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12o\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32W.google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent\x12,\n\x0bstruct_data\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1aj\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x42\x12\n\x10_relevance_score\x1a\xa9\x03\n\tChunkInfo\x12\x38\n\x05\x63hunk\x18\x01 \x01(\tB)\xfa\x41&\n$discoveryengine.googleapis.com/Chunk\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x12g\n\x11\x64ocument_metadata\x18\x04 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata\x1a\xb5\x01\n\x10\x44ocumentMetadata\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x04 \x01(\t\x12,\n\x0bstruct_data\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x12\n\x10_relevance_score\x1a\xac\x01\n\x16StructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12,\n\x0bstruct_data\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\x05title\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x42\t\n\x07\x63ontent\x1a\xbc\x08\n\x04Step\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32\x32.google.cloud.discoveryengine.v1.Answer.Step.State\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07thought\x18\x03 \x01(\t\x12\x44\n\x07\x61\x63tions\x18\x04 \x03(\x0b\x32\x33.google.cloud.discoveryengine.v1.Answer.Step.Action\x1a\xb8\x06\n\x06\x41\x63tion\x12Y\n\rsearch_action\x18\x02 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.Answer.Step.Action.SearchActionH\x00\x12T\n\x0bobservation\x18\x03 \x01(\x0b\x32?.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation\x1a\x1d\n\x0cSearchAction\x12\r\n\x05query\x18\x01 \x01(\t\x1a\xd3\x04\n\x0bObservation\x12\x64\n\x0esearch_results\x18\x02 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult\x1a\xdd\x03\n\x0cSearchResult\x12\x10\n\x08\x64ocument\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12n\n\x0csnippet_info\x18\x04 \x03(\x0b\x32X.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo\x12j\n\nchunk_info\x18\x05 \x03(\x0b\x32V.google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo\x12,\n\x0bstruct_data\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x36\n\x0bSnippetInfo\x12\x0f\n\x07snippet\x18\x01 \x01(\t\x12\x16\n\x0esnippet_status\x18\x02 \x01(\t\x1a]\n\tChunkInfo\x12\r\n\x05\x63hunk\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x1c\n\x0frelevance_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x42\x12\n\x10_relevance_scoreB\x08\n\x06\x61\x63tion\"J\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x1a\xe1\x03\n\x16QueryUnderstandingInfo\x12y\n\x19query_classification_info\x18\x01 \x03(\x0b\x32V.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo\x1a\xcb\x02\n\x17QueryClassificationInfo\x12i\n\x04type\x18\x01 \x01(\x0e\x32[.google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type\x12\x10\n\x08positive\x18\x02 \x01(\x08\"\xb2\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44VERSARIAL_QUERY\x10\x01\x12\x1c\n\x18NON_ANSWER_SEEKING_QUERY\x10\x02\x12\x17\n\x13JAIL_BREAKING_QUERY\x10\x03\x12\x1f\n\x1bNON_ANSWER_SEEKING_QUERY_V2\x10\x04\x12%\n!USER_DEFINED_CLASSIFICATION_QUERY\x10\x05\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\r\n\tSTREAMING\x10\x04\"\xa2\x03\n\x13\x41nswerSkippedReason\x12%\n!ANSWER_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12$\n NON_ANSWER_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x05\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x06\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x07\x12\'\n#NON_ANSWER_SEEKING_QUERY_IGNORED_V2\x10\x08\x12\x17\n\x13LOW_GROUNDED_ANSWER\x10\t\x12-\n)USER_DEFINED_CLASSIFICATION_QUERY_IGNORED\x10\n\x12\x14\n\x10UNHELPFUL_ANSWER\x10\x0b:\x85\x03\xea\x41\x81\x03\n%discoveryengine.googleapis.com/Answer\x12\x63projects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}/answers/{answer}\x12|projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}/answers/{answer}\x12uprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/answers/{answer}B\x12\n\x10_grounding_scoreB\xfe\x01\n#com.google.cloud.discoveryengine.v1B\x0b\x41nswerProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.SafetyRating", "google/cloud/discoveryengine/v1/safety.proto"], - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Answer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer").msgclass - Answer::Citation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Citation").msgclass - Answer::CitationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.CitationSource").msgclass - Answer::GroundingSupport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.GroundingSupport").msgclass - Answer::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference").msgclass - Answer::Reference::UnstructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo").msgclass - Answer::Reference::UnstructuredDocumentInfo::ChunkContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.UnstructuredDocumentInfo.ChunkContent").msgclass - Answer::Reference::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo").msgclass - Answer::Reference::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.ChunkInfo.DocumentMetadata").msgclass - Answer::Reference::StructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Reference.StructuredDocumentInfo").msgclass - Answer::Step = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step").msgclass - Answer::Step::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action").msgclass - Answer::Step::Action::SearchAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.SearchAction").msgclass - Answer::Step::Action::Observation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation").msgclass - Answer::Step::Action::Observation::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult").msgclass - Answer::Step::Action::Observation::SearchResult::SnippetInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.SnippetInfo").msgclass - Answer::Step::Action::Observation::SearchResult::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.Action.Observation.SearchResult.ChunkInfo").msgclass - Answer::Step::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.Step.State").enummodule - Answer::QueryUnderstandingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo").msgclass - Answer::QueryUnderstandingInfo::QueryClassificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo").msgclass - Answer::QueryUnderstandingInfo::QueryClassificationInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.QueryUnderstandingInfo.QueryClassificationInfo.Type").enummodule - Answer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.State").enummodule - Answer::AnswerSkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Answer.AnswerSkippedReason").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb deleted file mode 100644 index 88f096da08b6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assist_answer_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/assist_answer.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n3google/cloud/discoveryengine/v1/assist_answer.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x8d\x06\n\x0c\x41ssistAnswer\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32\x33.google.cloud.discoveryengine.v1.AssistAnswer.State\x12\x44\n\x07replies\x18\x03 \x03(\x0b\x32\x33.google.cloud.discoveryengine.v1.AssistAnswer.Reply\x12\x61\n\x16\x61ssist_skipped_reasons\x18\x05 \x03(\x0e\x32\x41.google.cloud.discoveryengine.v1.AssistAnswer.AssistSkippedReason\x1ag\n\x05Reply\x12U\n\x10grounded_content\x18\x01 \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AssistantGroundedContentH\x00\x42\x07\n\x05reply\"W\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0b\n\x07SKIPPED\x10\x04\"\x81\x01\n\x13\x41ssistSkippedReason\x12%\n!ASSIST_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12$\n NON_ASSIST_SEEKING_QUERY_IGNORED\x10\x01\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x02:\xb6\x01\xea\x41\xb2\x01\n+discoveryengine.googleapis.com/AssistAnswer\x12\x82\x01projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}\"\xb1\x06\n\x10\x41ssistantContent\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x12M\n\x0binline_data\x18\x03 \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.AssistantContent.BlobH\x00\x12\x46\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.AssistantContent.FileH\x00\x12[\n\x0f\x65xecutable_code\x18\x07 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.AssistantContent.ExecutableCodeH\x00\x12\x66\n\x15\x63ode_execution_result\x18\x08 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResultH\x00\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x14\n\x07thought\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x31\n\x04\x42lob\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x1a\x34\n\x04\x46ile\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66ile_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a#\n\x0e\x45xecutableCode\x12\x11\n\x04\x63ode\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xf6\x01\n\x13\x43odeExecutionResult\x12\x63\n\x07outcome\x18\x01 \x01(\x0e\x32M.google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult.OutcomeB\x03\xe0\x41\x02\x12\x13\n\x06output\x18\x02 \x01(\tB\x03\xe0\x41\x01\"e\n\x07Outcome\x12\x17\n\x13OUTCOME_UNSPECIFIED\x10\x00\x12\x0e\n\nOUTCOME_OK\x10\x01\x12\x12\n\x0eOUTCOME_FAILED\x10\x02\x12\x1d\n\x19OUTCOME_DEADLINE_EXCEEDED\x10\x03\x42\x06\n\x04\x64\x61ta\"\xdf\x07\n\x18\x41ssistantGroundedContent\x12r\n\x17text_grounding_metadata\x18\x03 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadataH\x00\x12\x42\n\x07\x63ontent\x18\x01 \x01(\x0b\x32\x31.google.cloud.discoveryengine.v1.AssistantContent\x1a\xfe\x05\n\x15TextGroundingMetadata\x12i\n\x08segments\x18\x04 \x03(\x0b\x32W.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Segment\x12m\n\nreferences\x18\x02 \x03(\x0b\x32Y.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference\x1as\n\x07Segment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12\x19\n\x11reference_indices\x18\x04 \x03(\x05\x12\x17\n\x0fgrounding_score\x18\x05 \x01(\x02\x12\x0c\n\x04text\x18\x06 \x01(\t\x1a\x95\x03\n\tReference\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x85\x01\n\x11\x64ocument_metadata\x18\x02 \x01(\x0b\x32j.google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference.DocumentMetadata\x1a\xee\x01\n\x10\x44ocumentMetadata\x12\x43\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentH\x00\x88\x01\x01\x12\x10\n\x03uri\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05title\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x1c\n\x0fpage_identifier\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x64omain\x18\x05 \x01(\tH\x04\x88\x01\x01\x42\x0b\n\t_documentB\x06\n\x04_uriB\x08\n\x06_titleB\x12\n\x10_page_identifierB\t\n\x07_domainB\n\n\x08metadataB\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11\x41ssistAnswerProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - AssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer").msgclass - AssistAnswer::Reply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.Reply").msgclass - AssistAnswer::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.State").enummodule - AssistAnswer::AssistSkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistAnswer.AssistSkippedReason").enummodule - AssistantContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent").msgclass - AssistantContent::Blob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.Blob").msgclass - AssistantContent::File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.File").msgclass - AssistantContent::ExecutableCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.ExecutableCode").msgclass - AssistantContent::CodeExecutionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult").msgclass - AssistantContent::CodeExecutionResult::Outcome = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantContent.CodeExecutionResult.Outcome").enummodule - AssistantGroundedContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent").msgclass - AssistantGroundedContent::TextGroundingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata").msgclass - AssistantGroundedContent::TextGroundingMetadata::Segment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Segment").msgclass - AssistantGroundedContent::TextGroundingMetadata::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference").msgclass - AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistantGroundedContent.TextGroundingMetadata.Reference.DocumentMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb deleted file mode 100644 index 248652636560..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/assistant.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n/google/cloud/discoveryengine/v1/assistant.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb9\x01\n\tAssistant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05:\x98\x01\xea\x41\x94\x01\n(discoveryengine.googleapis.com/Assistant\x12hprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}B\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x41ssistantProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Assistant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Assistant").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb deleted file mode 100644 index f9d6f1816674..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/assistant_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/assist_answer_pb' -require 'google/cloud/discoveryengine/v1/search_service_pb' -require 'google/cloud/discoveryengine/v1/session_pb' - - -descriptor_data = "\n7google/cloud/discoveryengine/v1/assistant_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/assist_answer.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\"R\n\x12\x41ssistUserMetadata\x12\x16\n\ttime_zone\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17preferred_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xba\t\n\x13StreamAssistRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/Assistant\x12:\n\x05query\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.QueryB\x03\xe0\x41\x01\x12?\n\x07session\x18\x03 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12O\n\ruser_metadata\x18\x06 \x01(\x0b\x32\x33.google.cloud.discoveryengine.v1.AssistUserMetadataB\x03\xe0\x41\x01\x12W\n\ntools_spec\x18\x12 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpecB\x03\xe0\x41\x01\x12\x61\n\x0fgeneration_spec\x18\x13 \x01(\x0b\x32\x43.google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpecB\x03\xe0\x41\x01\x1a\xaf\x05\n\tToolsSpec\x12u\n\x15vertex_ai_search_spec\x18\x01 \x01(\x0b\x32Q.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VertexAiSearchSpecB\x03\xe0\x41\x01\x12p\n\x12web_grounding_spec\x18\x02 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.WebGroundingSpecB\x03\xe0\x41\x01\x12v\n\x15image_generation_spec\x18\x03 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.ImageGenerationSpecB\x03\xe0\x41\x01\x12v\n\x15video_generation_spec\x18\x04 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VideoGenerationSpecB\x03\xe0\x41\x01\x1a\x86\x01\n\x12VertexAiSearchSpec\x12[\n\x10\x64\x61ta_store_specs\x18\x02 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpecB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x12\n\x10WebGroundingSpec\x1a\x15\n\x13ImageGenerationSpec\x1a\x15\n\x13VideoGenerationSpec\x1a\'\n\x0eGenerationSpec\x12\x15\n\x08model_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\x91\x02\n\x14StreamAssistResponse\x12=\n\x06\x61nswer\x18\x01 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.AssistAnswer\x12W\n\x0csession_info\x18\x02 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.StreamAssistResponse.SessionInfo\x12\x14\n\x0c\x61ssist_token\x18\x04 \x01(\t\x1aK\n\x0bSessionInfo\x12<\n\x07session\x18\x01 \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session2\xc6\x02\n\x10\x41ssistantService\x12\xdd\x01\n\x0cStreamAssist\x12\x34.google.cloud.discoveryengine.v1.StreamAssistRequest\x1a\x35.google.cloud.discoveryengine.v1.StreamAssistResponse\"^\x82\xd3\xe4\x93\x02X\"S/v1/{name=projects/*/locations/*/collections/*/engines/*/assistants/*}:streamAssist:\x01*0\x01\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15\x41ssistantServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.Query", "google/cloud/discoveryengine/v1/session.proto"], - ["google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec", "google/cloud/discoveryengine/v1/search_service.proto"], - ["google.cloud.discoveryengine.v1.AssistAnswer", "google/cloud/discoveryengine/v1/assist_answer.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - AssistUserMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AssistUserMetadata").msgclass - StreamAssistRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest").msgclass - StreamAssistRequest::ToolsSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec").msgclass - StreamAssistRequest::ToolsSpec::VertexAiSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VertexAiSearchSpec").msgclass - StreamAssistRequest::ToolsSpec::WebGroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.WebGroundingSpec").msgclass - StreamAssistRequest::ToolsSpec::ImageGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.ImageGenerationSpec").msgclass - StreamAssistRequest::ToolsSpec::VideoGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.ToolsSpec.VideoGenerationSpec").msgclass - StreamAssistRequest::GenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistRequest.GenerationSpec").msgclass - StreamAssistResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistResponse").msgclass - StreamAssistResponse::SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.StreamAssistResponse.SessionInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb deleted file mode 100644 index 5de4fd4e5cbb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/assistant_service_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/assistant_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/assistant_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module AssistantService - # Service for managing Assistant configuration and assisting users. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.AssistantService' - - # Assists the user with a query in a streaming fashion. - rpc :StreamAssist, ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, stream(::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb deleted file mode 100644 index 85726d7ee387..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/chunk.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n+google/cloud/discoveryengine/v1/chunk.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xff\x0b\n\x05\x43hunk\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12!\n\x0frelevance_score\x18\x08 \x01(\x01\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12R\n\x11\x64ocument_metadata\x18\x05 \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Chunk.DocumentMetadata\x12\x39\n\x13\x64\x65rived_struct_data\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x03\x12\x42\n\tpage_span\x18\x06 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.Chunk.PageSpan\x12Q\n\x0e\x63hunk_metadata\x18\x07 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Chunk.ChunkMetadataB\x03\xe0\x41\x03\x12\x16\n\tdata_urls\x18\t \x03(\tB\x03\xe0\x41\x03\x12 \n\x13\x61nnotation_contents\x18\x0b \x03(\tB\x03\xe0\x41\x03\x12[\n\x13\x61nnotation_metadata\x18\x0c \x03(\x0b\x32\x39.google.cloud.discoveryengine.v1.Chunk.AnnotationMetadataB\x03\xe0\x41\x03\x1a\\\n\x10\x44ocumentMetadata\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12,\n\x0bstruct_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x30\n\x08PageSpan\x12\x12\n\npage_start\x18\x01 \x01(\x05\x12\x10\n\x08page_end\x18\x02 \x01(\x05\x1a\x8d\x01\n\rChunkMetadata\x12?\n\x0fprevious_chunks\x18\x01 \x03(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12;\n\x0bnext_chunks\x18\x02 \x03(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x1a|\n\x11StructuredContent\x12Q\n\x0estructure_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.discoveryengine.v1.Chunk.StructureTypeB\x03\xe0\x41\x03\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x86\x01\n\x12\x41nnotationMetadata\x12Y\n\x12structured_content\x18\x01 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.Chunk.StructuredContentB\x03\xe0\x41\x03\x12\x15\n\x08image_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\"{\n\rStructureType\x12\x1e\n\x1aSTRUCTURE_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15SHAREHOLDER_STRUCTURE\x10\x01\x12\x17\n\x13SIGNATURE_STRUCTURE\x10\x02\x12\x16\n\x12\x43HECKBOX_STRUCTURE\x10\x03:\xb2\x02\xea\x41\xae\x02\n$discoveryengine.googleapis.com/Chunk\x12uprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}\x12\x8e\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}B\x12\n\x10_relevance_scoreB\xfd\x01\n#com.google.cloud.discoveryengine.v1B\nChunkProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Chunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk").msgclass - Chunk::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.DocumentMetadata").msgclass - Chunk::PageSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.PageSpan").msgclass - Chunk::ChunkMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.ChunkMetadata").msgclass - Chunk::StructuredContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.StructuredContent").msgclass - Chunk::AnnotationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.AnnotationMetadata").msgclass - Chunk::StructureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Chunk.StructureType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb deleted file mode 100644 index f33f9d187550..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/cmek_config_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n9google/cloud/discoveryengine/v1/cmek_config_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"p\n\x17UpdateCmekConfigRequest\x12@\n\x06\x63onfig\x18\x01 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x02\x12\x13\n\x0bset_default\x18\x02 \x01(\x08\"W\n\x14GetCmekConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfig\"N\n\x0fSingleRegionKey\x12;\n\x07kms_key\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"cloudkms.googleapis.com/CryptoKeys\"\xc1\x07\n\nCmekConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x07kms_key\x18\x02 \x01(\tB\'\xfa\x41$\n\"cloudkms.googleapis.com/CryptoKeys\x12G\n\x0fkms_key_version\x18\x06 \x01(\tB.\xfa\x41+\n)cloudkms.googleapis.com/CryptoKeyVersions\x12\x45\n\x05state\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.CmekConfig.StateB\x03\xe0\x41\x03\x12\x17\n\nis_default\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\x1elast_rotation_timestamp_micros\x18\x05 \x01(\x03\x42\x03\xe0\x41\x03\x12Q\n\x12single_region_keys\x18\x07 \x03(\x0b\x32\x30.google.cloud.discoveryengine.v1.SingleRegionKeyB\x03\xe0\x41\x01\x12Z\n\x10notebooklm_state\x18\x08 \x01(\x0e\x32;.google.cloud.discoveryengine.v1.CmekConfig.NotebookLMStateB\x03\xe0\x41\x03\"\x98\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\r\n\tKEY_ISSUE\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x11\n\rDELETE_FAILED\x10\x07\x12\x0c\n\x08UNUSABLE\x10\x05\x12\x13\n\x0f\x41\x43TIVE_ROTATING\x10\x06\x12\x0b\n\x07\x44\x45LETED\x10\x08\"\x83\x01\n\x0fNotebookLMState\x12!\n\x1dNOTEBOOK_LM_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15NOTEBOOK_LM_NOT_READY\x10\x01\x12\x15\n\x11NOTEBOOK_LM_READY\x10\x02\x12\x1b\n\x17NOTEBOOK_LM_NOT_ENABLED\x10\x03:\xbf\x01\xea\x41\xbb\x01\n)discoveryengine.googleapis.com/CmekConfig\x12\x32projects/{project}/locations/{location}/cmekConfig\x12\x41projects/{project}/locations/{location}/cmekConfigs/{cmek_config}*\x0b\x63mekConfigs2\ncmekConfig\"|\n\x18UpdateCmekConfigMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x16ListCmekConfigsRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Location\"\\\n\x17ListCmekConfigsResponse\x12\x41\n\x0c\x63mek_configs\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfig\"Z\n\x17\x44\x65leteCmekConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfig\"|\n\x18\x44\x65leteCmekConfigMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x81\t\n\x11\x43mekConfigService\x12\xe5\x02\n\x10UpdateCmekConfig\x12\x38.google.cloud.discoveryengine.v1.UpdateCmekConfigRequest\x1a\x1d.google.longrunning.Operation\"\xf7\x01\xca\x41\x66\n*google.cloud.discoveryengine.v1.CmekConfig\x12\x38google.cloud.discoveryengine.v1.UpdateCmekConfigMetadata\xda\x41\x06\x63onfig\x82\xd3\xe4\x93\x02\x7f\x32\x33/v1/{config.name=projects/*/locations/*/cmekConfig}:\x06\x63onfigZ@26/v1/{config.name=projects/*/locations/*/cmekConfigs/*}:\x06\x63onfig\x12\xe3\x01\n\rGetCmekConfig\x12\x35.google.cloud.discoveryengine.v1.GetCmekConfigRequest\x1a+.google.cloud.discoveryengine.v1.CmekConfig\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12,/v1/{name=projects/*/locations/*/cmekConfig}Z1\x12//v1/{name=projects/*/locations/*/cmekConfigs/*}\x12\xc6\x01\n\x0fListCmekConfigs\x12\x37.google.cloud.discoveryengine.v1.ListCmekConfigsRequest\x1a\x38.google.cloud.discoveryengine.v1.ListCmekConfigsResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/cmekConfigs\x12\x80\x02\n\x10\x44\x65leteCmekConfig\x12\x38.google.cloud.discoveryengine.v1.DeleteCmekConfigRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41Q\n\x15google.protobuf.Empty\x12\x38google.cloud.discoveryengine.v1.DeleteCmekConfigMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/cmekConfigs/*}\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43mekConfigServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - UpdateCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateCmekConfigRequest").msgclass - GetCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetCmekConfigRequest").msgclass - SingleRegionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SingleRegionKey").msgclass - CmekConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig").msgclass - CmekConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig.State").enummodule - CmekConfig::NotebookLMState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CmekConfig.NotebookLMState").enummodule - UpdateCmekConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateCmekConfigMetadata").msgclass - ListCmekConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCmekConfigsRequest").msgclass - ListCmekConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCmekConfigsResponse").msgclass - DeleteCmekConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteCmekConfigRequest").msgclass - DeleteCmekConfigMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteCmekConfigMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb deleted file mode 100644 index 0cc0e58b4fd1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/cmek_config_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CmekConfigService - # Service for managing CMEK related tasks - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.CmekConfigService' - - # Provisions a CMEK key for use in a location of a customer's project. - # This method will also conduct location validation on the provided - # cmekConfig to make sure the key is valid and can be used in the - # selected location. - rpc :UpdateCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::Google::Longrunning::Operation - # Gets the [CmekConfig][google.cloud.discoveryengine.v1.CmekConfig]. - rpc :GetCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::Google::Cloud::DiscoveryEngine::V1::CmekConfig - # Lists all the [CmekConfig][google.cloud.discoveryengine.v1.CmekConfig]s - # with the project. - rpc :ListCmekConfigs, ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse - # De-provisions a CmekConfig. - rpc :DeleteCmekConfig, ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb deleted file mode 100644 index f319917117f9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/common_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n,google/cloud/discoveryengine/v1/common.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"x\n\x08Interval\x12\x11\n\x07minimum\x18\x01 \x01(\x01H\x00\x12\x1b\n\x11\x65xclusive_minimum\x18\x02 \x01(\x01H\x00\x12\x11\n\x07maximum\x18\x03 \x01(\x01H\x01\x12\x1b\n\x11\x65xclusive_maximum\x18\x04 \x01(\x01H\x01\x42\x05\n\x03minB\x05\n\x03max\"0\n\x0f\x43ustomAttribute\x12\x0c\n\x04text\x18\x01 \x03(\t\x12\x0f\n\x07numbers\x18\x02 \x03(\x01\"G\n\x08UserInfo\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\nuser_agent\x18\x02 \x01(\t\x12\x16\n\ttime_zone\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x1c\n\nDoubleList\x12\x0e\n\x06values\x18\x01 \x03(\x01\"]\n\tPrincipal\x12\x11\n\x07user_id\x18\x01 \x01(\tH\x00\x12\x12\n\x08group_id\x18\x02 \x01(\tH\x00\x12\x1c\n\x12\x65xternal_entity_id\x18\x03 \x01(\tH\x00\x42\x0b\n\tprincipal\"n\n\x14HealthcareFhirConfig\x12\"\n\x1a\x65nable_configurable_schema\x18\x01 \x01(\x08\x12\x32\n*enable_static_indexing_for_batch_ingestion\x18\x02 \x01(\x08\"\xc6\x01\n\x13SearchLinkPromotion\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x08\x64ocument\x18\x06 \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x65nabled\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01*b\n\x10IndustryVertical\x12!\n\x1dINDUSTRY_VERTICAL_UNSPECIFIED\x10\x00\x12\x0b\n\x07GENERIC\x10\x01\x12\t\n\x05MEDIA\x10\x02\x12\x13\n\x0fHEALTHCARE_FHIR\x10\x07*\xa4\x01\n\x0cSolutionType\x12\x1d\n\x19SOLUTION_TYPE_UNSPECIFIED\x10\x00\x12 \n\x1cSOLUTION_TYPE_RECOMMENDATION\x10\x01\x12\x18\n\x14SOLUTION_TYPE_SEARCH\x10\x02\x12\x16\n\x12SOLUTION_TYPE_CHAT\x10\x03\x12!\n\x1dSOLUTION_TYPE_GENERATIVE_CHAT\x10\x04*h\n\rSearchUseCase\x12\x1f\n\x1bSEARCH_USE_CASE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SEARCH_USE_CASE_SEARCH\x10\x01\x12\x1a\n\x16SEARCH_USE_CASE_BROWSE\x10\x02*_\n\nSearchTier\x12\x1b\n\x17SEARCH_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SEARCH_TIER_STANDARD\x10\x01\x12\x1a\n\x16SEARCH_TIER_ENTERPRISE\x10\x02*C\n\x0bSearchAddOn\x12\x1d\n\x19SEARCH_ADD_ON_UNSPECIFIED\x10\x00\x12\x15\n\x11SEARCH_ADD_ON_LLM\x10\x01\x42\xda\r\n#com.google.cloud.discoveryengine.v1B\x0b\x43ommonProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1\xea\x41\xe6\x01\n%discoveryengine.googleapis.com/Branch\x12Qprojects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}\x12jprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}\xea\x41m\n)discoveryengine.googleapis.com/Collection\x12@projects/{project}/locations/{location}/collections/{collection}\xea\x41R\n\'discoveryengine.googleapis.com/Location\x12\'projects/{project}/locations/{location}\xea\x41}\n.discoveryengine.googleapis.com/GroundingConfig\x12Kprojects/{project}/locations/{location}/groundingConfigs/{grounding_config}\xea\x41w\n,discoveryengine.googleapis.com/RankingConfig\x12Gprojects/{project}/locations/{location}/rankingConfigs/{ranking_config}\xea\x41w\n,discoveryengine.googleapis.com/LicenseConfig\x12Gprojects/{project}/locations/{location}/licenseConfigs/{license_config}\xea\x41k\n(discoveryengine.googleapis.com/UserStore\x12?projects/{project}/locations/{location}/userStores/{user_store}\xea\x41y\n#healthcare.googleapis.com/FhirStore\x12Rprojects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}\xea\x41\xa4\x01\n&healthcare.googleapis.com/FhirResource\x12zprojects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}\xea\x41y\n\"cloudkms.googleapis.com/CryptoKeys\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa7\x01\n)cloudkms.googleapis.com/CryptoKeyVersions\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Interval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Interval").msgclass - CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomAttribute").msgclass - UserInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserInfo").msgclass - DoubleList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DoubleList").msgclass - Principal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Principal").msgclass - HealthcareFhirConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.HealthcareFhirConfig").msgclass - SearchLinkPromotion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchLinkPromotion").msgclass - IndustryVertical = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.IndustryVertical").enummodule - SolutionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SolutionType").enummodule - SearchUseCase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchUseCase").enummodule - SearchTier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchTier").enummodule - SearchAddOn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchAddOn").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb deleted file mode 100644 index bfe378e7a8b1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/completion.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n0google/cloud/discoveryengine/v1/completion.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\"\xe9\x01\n\x17SuggestionDenyListEntry\x12\x19\n\x0c\x62lock_phrase\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x63\n\x0ematch_operator\x18\x02 \x01(\x0e\x32\x46.google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperatorB\x03\xe0\x41\x02\"N\n\rMatchOperator\x12\x1e\n\x1aMATCH_OPERATOR_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45XACT_MATCH\x10\x01\x12\x0c\n\x08\x43ONTAINS\x10\x02\"\xc7\x01\n\x14\x43ompletionSuggestion\x12\x16\n\x0cglobal_score\x18\x02 \x01(\x01H\x00\x12\x13\n\tfrequency\x18\x03 \x01(\x03H\x00\x12\x17\n\nsuggestion\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12\x10\n\x08group_id\x18\x05 \x01(\t\x12\x13\n\x0bgroup_score\x18\x06 \x01(\x01\x12\x1b\n\x13\x61lternative_phrases\x18\x07 \x03(\tB\x0e\n\x0cranking_infoB\x82\x02\n#com.google.cloud.discoveryengine.v1B\x0f\x43ompletionProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - SuggestionDenyListEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SuggestionDenyListEntry").msgclass - SuggestionDenyListEntry::MatchOperator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperator").enummodule - CompletionSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompletionSuggestion").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb deleted file mode 100644 index 5896c1b91e3a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/completion_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/import_config_pb' -require 'google/cloud/discoveryengine/v1/purge_config_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n8google/cloud/discoveryengine/v1/completion_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a#google/longrunning/operations.proto\"\xbf\x01\n\x14\x43ompleteQueryRequest\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0bquery_model\x18\x03 \x01(\t\x12\x16\n\x0euser_pseudo_id\x18\x04 \x01(\t\x12 \n\x18include_tail_suggestions\x18\x05 \x01(\x08\"\xe0\x01\n\x15\x43ompleteQueryResponse\x12\x61\n\x11query_suggestions\x18\x01 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion\x12\x1c\n\x14tail_match_triggered\x18\x02 \x01(\x08\x1a\x46\n\x0fQuerySuggestion\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12\x1f\n\x17\x63ompletable_field_paths\x18\x02 \x03(\t2\xef\x11\n\x11\x43ompletionService\x12\xa0\x02\n\rCompleteQuery\x12\x35.google.cloud.discoveryengine.v1.CompleteQueryRequest\x1a\x36.google.cloud.discoveryengine.v1.CompleteQueryResponse\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x12\x42/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQueryZR\x12P/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery\x12\xe5\x03\n\x1fImportSuggestionDenyListEntries\x12G.google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x02\xca\x41\x92\x01\nGgoogle.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesResponse\x12Ggoogle.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesMetadata\x82\xd3\xe4\x93\x02\xbc\x01\"_/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:import:\x01*ZV\"Q/v1/{parent=projects/*/locations/*/dataStores/*}/suggestionDenyListEntries:import:\x01*\x12\xe0\x03\n\x1ePurgeSuggestionDenyListEntries\x12\x46.google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\x90\x01\nFgoogle.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse\x12\x46google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata\x82\xd3\xe4\x93\x02\xbb\x01\"^/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:purge:\x01*ZV\"Q/v1/{parent=projects/*/locations/*/dataStores/**}/suggestionDenyListEntries:purge:\x01*\x12\xcd\x03\n\x1bImportCompletionSuggestions\x12\x43.google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x02\xca\x41\x8a\x01\nCgoogle.cloud.discoveryengine.v1.ImportCompletionSuggestionsResponse\x12\x43google.cloud.discoveryengine.v1.ImportCompletionSuggestionsMetadata\x82\xd3\xe4\x93\x02\xb4\x01\"[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:import:\x01*ZR\"M/v1/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:import:\x01*\x12\xc7\x03\n\x1aPurgeCompletionSuggestions\x12\x42.google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x02\xca\x41\x88\x01\nBgoogle.cloud.discoveryengine.v1.PurgeCompletionSuggestionsResponse\x12\x42google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsMetadata\x82\xd3\xe4\x93\x02\xb2\x01\"Z/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:purge:\x01*ZQ\"L/v1/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:purge:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43ompletionServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryRequest").msgclass - CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse").msgclass - CompleteQueryResponse::QuerySuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompleteQueryResponse.QuerySuggestion").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb deleted file mode 100644 index bf4e20e07088..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/completion_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/completion_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module CompletionService - # Service for Auto-Completion. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.CompletionService' - - # Completes the specified user input with keyword suggestions. - rpc :CompleteQuery, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse - # Imports all - # [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry] - # for a DataStore. - rpc :ImportSuggestionDenyListEntries, ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, ::Google::Longrunning::Operation - # Permanently deletes all - # [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry] - # for a DataStore. - rpc :PurgeSuggestionDenyListEntries, ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, ::Google::Longrunning::Operation - # Imports - # [CompletionSuggestion][google.cloud.discoveryengine.v1.CompletionSuggestion]s - # for a DataStore. - rpc :ImportCompletionSuggestions, ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, ::Google::Longrunning::Operation - # Permanently deletes all - # [CompletionSuggestion][google.cloud.discoveryengine.v1.CompletionSuggestion]s - # for a DataStore. - rpc :PurgeCompletionSuggestions, ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb deleted file mode 100644 index bf4bde59cc6e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/control.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/discoveryengine/v1/control.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdc\x02\n\tCondition\x12I\n\x0bquery_terms\x18\x02 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.Condition.QueryTerm\x12O\n\x11\x61\x63tive_time_range\x18\x03 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.Condition.TimeRange\x12\x18\n\x0bquery_regex\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a.\n\tQueryTerm\x12\r\n\x05value\x18\x01 \x01(\t\x12\x12\n\nfull_match\x18\x02 \x01(\x08\x1ai\n\tTimeRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb8\x12\n\x07\x43ontrol\x12L\n\x0c\x62oost_action\x18\x06 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Control.BoostActionH\x00\x12N\n\rfilter_action\x18\x07 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.Control.FilterActionH\x00\x12R\n\x0fredirect_action\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Control.RedirectActionH\x00\x12R\n\x0fsynonyms_action\x18\n \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.Control.SynonymsActionH\x00\x12P\n\x0epromote_action\x18\x0f \x01(\x0b\x32\x36.google.cloud.discoveryengine.v1.Control.PromoteActionH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12*\n\x1d\x61ssociated_serving_config_ids\x18\x03 \x03(\tB\x03\xe0\x41\x03\x12L\n\rsolution_type\x18\x04 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x41\n\tuse_cases\x18\x08 \x03(\x0e\x32..google.cloud.discoveryengine.v1.SearchUseCase\x12>\n\nconditions\x18\x05 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.Condition\x1a\x9b\x07\n\x0b\x42oostAction\x12\x1a\n\x0b\x66ixed_boost\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x12t\n\x18interpolation_boost_spec\x18\x05 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpecB\x03\xe0\x41\x01H\x00\x12\x11\n\x05\x62oost\x18\x01 \x01(\x02\x42\x02\x18\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\ndata_store\x18\x03 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a\xfd\x04\n\x16InterpolationBoostSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12v\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32Y.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.AttributeTypeB\x03\xe0\x41\x01\x12~\n\x12interpolation_type\x18\x03 \x01(\x0e\x32].google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.InterpolationTypeB\x03\xe0\x41\x01\x12u\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32X.google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.ControlPointB\x03\xe0\x41\x01\x1aG\n\x0c\x43ontrolPoint\x12\x1c\n\x0f\x61ttribute_value\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x62oost_amount\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x42\x0c\n\nboost_spec\x1ai\n\x0c\x46ilterAction\x12\x13\n\x06\x66ilter\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\ndata_store\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a+\n\x0eRedirectAction\x12\x19\n\x0credirect_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\"\n\x0eSynonymsAction\x12\x10\n\x08synonyms\x18\x01 \x03(\t\x1a\xaf\x01\n\rPromoteAction\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12X\n\x15search_link_promotion\x18\x02 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotionB\x03\xe0\x41\x02:\xd3\x02\xea\x41\xcf\x02\n&discoveryengine.googleapis.com/Control\x12Rprojects/{project}/locations/{location}/dataStores/{data_store}/controls/{control}\x12kprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/controls/{control}\x12\x64projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/controls/{control}B\x08\n\x06\x61\x63tionB\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0c\x43ontrolProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.SearchLinkPromotion", "google/cloud/discoveryengine/v1/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition").msgclass - Condition::QueryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition.QueryTerm").msgclass - Condition::TimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Condition.TimeRange").msgclass - Control = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control").msgclass - Control::BoostAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction").msgclass - Control::BoostAction::InterpolationBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec").msgclass - Control::BoostAction::InterpolationBoostSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.ControlPoint").msgclass - Control::BoostAction::InterpolationBoostSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.AttributeType").enummodule - Control::BoostAction::InterpolationBoostSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.BoostAction.InterpolationBoostSpec.InterpolationType").enummodule - Control::FilterAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.FilterAction").msgclass - Control::RedirectAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.RedirectAction").msgclass - Control::SynonymsAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.SynonymsAction").msgclass - Control::PromoteAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Control.PromoteAction").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb deleted file mode 100644 index dfa16266f351..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/control_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/control_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n5google/cloud/discoveryengine/v1/control_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/discoveryengine/v1/control.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xaf\x01\n\x14\x43reateControlRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&discoveryengine.googleapis.com/Control\x12>\n\x07\x63ontrol\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.ControlB\x03\xe0\x41\x02\x12\x17\n\ncontrol_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x8c\x01\n\x14UpdateControlRequest\x12>\n\x07\x63ontrol\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.ControlB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"T\n\x14\x44\x65leteControlRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Control\"Q\n\x11GetControlRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Control\"\x9b\x01\n\x13ListControlsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&discoveryengine.googleapis.com/Control\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"k\n\x14ListControlsResponse\x12:\n\x08\x63ontrols\x18\x01 \x03(\x0b\x32(.google.cloud.discoveryengine.v1.Control\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe5\x0e\n\x0e\x43ontrolService\x12\xff\x02\n\rCreateControl\x12\x35.google.cloud.discoveryengine.v1.CreateControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\x8c\x02\xda\x41\x19parent,control,control_id\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/controls:\x07\x63ontrolZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controls:\x07\x63ontrolZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls:\x07\x63ontrol\x12\xbd\x02\n\rDeleteControl\x12\x35.google.cloud.discoveryengine.v1.DeleteControlRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}\x12\x91\x03\n\rUpdateControl\x12\x35.google.cloud.discoveryengine.v1.UpdateControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\x9e\x02\xda\x41\x13\x63ontrol,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{control.name=projects/*/locations/*/dataStores/*/controls/*}:\x07\x63ontrolZZ2O/v1/{control.name=projects/*/locations/*/collections/*/dataStores/*/controls/*}:\x07\x63ontrolZW2L/v1/{control.name=projects/*/locations/*/collections/*/engines/*/controls/*}:\x07\x63ontrol\x12\xc9\x02\n\nGetControl\x12\x32.google.cloud.discoveryengine.v1.GetControlRequest\x1a(.google.cloud.discoveryengine.v1.Control\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/controls/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/controls/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/controls/*}\x12\xdc\x02\n\x0cListControls\x12\x34.google.cloud.discoveryengine.v1.ListControlsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListControlsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/controlsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/controlsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/controls\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13\x43ontrolServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.Control", "google/cloud/discoveryengine/v1/control.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - CreateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateControlRequest").msgclass - UpdateControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateControlRequest").msgclass - DeleteControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteControlRequest").msgclass - GetControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetControlRequest").msgclass - ListControlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListControlsRequest").msgclass - ListControlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListControlsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb deleted file mode 100644 index 9cbd2d3cb5e3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb +++ /dev/null @@ -1,69 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/control_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/control_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ControlService - # Service for performing CRUD operations on Controls. - # Controls allow for custom logic to be implemented in the serving path. - # Controls need to be attached to a Serving Config to be considered during a - # request. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.ControlService' - - # Creates a Control. - # - # By default 1000 controls are allowed for a data store. - # A request can be submitted to adjust this limit. - # If the [Control][google.cloud.discoveryengine.v1.Control] to create already - # exists, an ALREADY_EXISTS error is returned. - rpc :CreateControl, ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control - # Deletes a Control. - # - # If the [Control][google.cloud.discoveryengine.v1.Control] to delete does - # not exist, a NOT_FOUND error is returned. - rpc :DeleteControl, ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::Google::Protobuf::Empty - # Updates a Control. - # - # [Control][google.cloud.discoveryengine.v1.Control] action type cannot be - # changed. If the [Control][google.cloud.discoveryengine.v1.Control] to - # update does not exist, a NOT_FOUND error is returned. - rpc :UpdateControl, ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control - # Gets a Control. - rpc :GetControl, ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::Google::Cloud::DiscoveryEngine::V1::Control - # Lists all Controls by their parent - # [DataStore][google.cloud.discoveryengine.v1.DataStore]. - rpc :ListControls, ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb deleted file mode 100644 index df47999f1444..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/conversation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/search_service_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/discoveryengine/v1/conversation.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe6\x05\n\x0c\x43onversation\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x42\n\x05state\x18\x02 \x01(\x0e\x32\x33.google.cloud.discoveryengine.v1.Conversation.State\x12\x16\n\x0euser_pseudo_id\x18\x03 \x01(\t\x12\x46\n\x08messages\x18\x04 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.ConversationMessage\x12\x33\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\">\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02:\xf6\x02\xea\x41\xf2\x02\n+discoveryengine.googleapis.com/Conversation\x12\\projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}\x12uprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}\x12nprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}\"Q\n\x05Reply\x12H\n\x07summary\x18\x03 \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\"I\n\x13\x43onversationContext\x12\x19\n\x11\x63ontext_documents\x18\x01 \x03(\t\x12\x17\n\x0f\x61\x63tive_document\x18\x02 \x01(\t\"a\n\tTextInput\x12\r\n\x05input\x18\x01 \x01(\t\x12\x45\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.ConversationContext\"\xd1\x01\n\x13\x43onversationMessage\x12@\n\nuser_input\x18\x01 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.TextInputH\x00\x12\x37\n\x05reply\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.ReplyH\x00\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\t\n\x07messageB\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11\x43onversationProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.SearchResponse.Summary", "google/cloud/discoveryengine/v1/search_service.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Conversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Conversation").msgclass - Conversation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Conversation.State").enummodule - Reply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Reply").msgclass - ConversationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConversationContext").msgclass - TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TextInput").msgclass - ConversationMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConversationMessage").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb deleted file mode 100644 index dd9d20a907d5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/conversational_search_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/answer_pb' -require 'google/cloud/discoveryengine/v1/conversation_pb' -require 'google/cloud/discoveryengine/v1/safety_pb' -require 'google/cloud/discoveryengine/v1/search_service_pb' -require 'google/cloud/discoveryengine/v1/session_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\nCgoogle/cloud/discoveryengine/v1/conversational_search_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/answer.proto\x1a\x32google/cloud/discoveryengine/v1/conversation.proto\x1a,google/cloud/discoveryengine/v1/safety.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9d\x05\n\x1b\x43onverseConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\x12>\n\x05query\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.TextInputB\x03\xe0\x41\x02\x12I\n\x0eserving_config\x18\x03 \x01(\tB1\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12\x43\n\x0c\x63onversation\x18\x05 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12\x13\n\x0bsafe_search\x18\x06 \x01(\x08\x12\x61\n\x0buser_labels\x18\x07 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.ConverseConversationRequest.UserLabelsEntry\x12\x62\n\x0csummary_spec\x18\x08 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12\x0e\n\x06\x66ilter\x18\t \x01(\t\x12L\n\nboost_spec\x18\n \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf0\x01\n\x1c\x43onverseConversationResponse\x12\x35\n\x05reply\x18\x01 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Reply\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12T\n\x0esearch_results\x18\x03 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\"\xa7\x01\n\x19\x43reateConversationRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.ConversationB\x03\xe0\x41\x02\"\x96\x01\n\x19UpdateConversationRequest\x12H\n\x0c\x63onversation\x18\x01 \x01(\x0b\x32-.google.cloud.discoveryengine.v1.ConversationB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"^\n\x19\x44\x65leteConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\"[\n\x16GetConversationRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+discoveryengine.googleapis.com/Conversation\"\xa5\x01\n\x18ListConversationsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"z\n\x19ListConversationsResponse\x12\x44\n\rconversations\x18\x01 \x03(\x0b\x32-.google.cloud.discoveryengine.v1.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8b\x30\n\x12\x41nswerQueryRequest\x12L\n\x0eserving_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12:\n\x05query\x18\x02 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.QueryB\x03\xe0\x41\x02\x12<\n\x07session\x18\x03 \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12S\n\x0bsafety_spec\x18\x04 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec\x12h\n\x16related_questions_spec\x18\x05 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec\x12^\n\x0egrounding_spec\x18\x06 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpecB\x03\xe0\x41\x01\x12h\n\x16\x61nswer_generation_spec\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec\x12S\n\x0bsearch_spec\x18\x08 \x01(\x0b\x32>.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec\x12l\n\x18query_understanding_spec\x18\t \x01(\x0b\x32J.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec\x12\x1d\n\x11\x61synchronous_mode\x18\n \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0euser_pseudo_id\x18\x0c \x01(\t\x12X\n\x0buser_labels\x18\r \x03(\x0b\x32\x43.google.cloud.discoveryengine.v1.AnswerQueryRequest.UserLabelsEntry\x12[\n\rend_user_spec\x18\x0e \x01(\x0b\x32?.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpecB\x03\xe0\x41\x01\x1a\xf9\x03\n\nSafetySpec\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\x12j\n\x0fsafety_settings\x18\x02 \x03(\x0b\x32L.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySettingB\x03\xe0\x41\x01\x1a\xee\x02\n\rSafetySetting\x12\x44\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.HarmCategoryB\x03\xe0\x41\x02\x12w\n\tthreshold\x18\x02 \x01(\x0e\x32_.google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting.HarmBlockThresholdB\x03\xe0\x41\x02\"\x9d\x01\n\x12HarmBlockThreshold\x12$\n HARM_BLOCK_THRESHOLD_UNSPECIFIED\x10\x00\x12\x17\n\x13\x42LOCK_LOW_AND_ABOVE\x10\x01\x12\x1a\n\x16\x42LOCK_MEDIUM_AND_ABOVE\x10\x02\x12\x13\n\x0f\x42LOCK_ONLY_HIGH\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04\x12\x07\n\x03OFF\x10\x05\x1a&\n\x14RelatedQuestionsSpec\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\x1a\x8e\x02\n\rGroundingSpec\x12\'\n\x1ainclude_grounding_supports\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12n\n\x0f\x66iltering_level\x18\x03 \x01(\x0e\x32P.google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec.FilteringLevelB\x03\xe0\x41\x01\"d\n\x0e\x46ilteringLevel\x12\x1f\n\x1b\x46ILTERING_LEVEL_UNSPECIFIED\x10\x00\x12\x17\n\x13\x46ILTERING_LEVEL_LOW\x10\x01\x12\x18\n\x14\x46ILTERING_LEVEL_HIGH\x10\x02\x1a\xa3\x04\n\x14\x41nswerGenerationSpec\x12\x66\n\nmodel_spec\x18\x01 \x01(\x0b\x32R.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec\x12h\n\x0bprompt_spec\x18\x02 \x01(\x0b\x32S.google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec\x12\x19\n\x11include_citations\x18\x03 \x01(\x08\x12\x1c\n\x14\x61nswer_language_code\x18\x04 \x01(\t\x12 \n\x18ignore_adversarial_query\x18\x05 \x01(\x08\x12\'\n\x1fignore_non_answer_seeking_query\x18\x06 \x01(\x08\x12(\n\x1bignore_low_relevant_content\x18\x07 \x01(\x08H\x00\x88\x01\x01\x12\'\n\x1aignore_jail_breaking_query\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x1a\"\n\tModelSpec\x12\x15\n\rmodel_version\x18\x01 \x01(\t\x1a\x1e\n\nPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\tB\x1e\n\x1c_ignore_low_relevant_content\x1a\xd8\x10\n\nSearchSpec\x12\x64\n\rsearch_params\x18\x01 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParamsH\x00\x12m\n\x12search_result_list\x18\x02 \x01(\x0b\x32O.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultListH\x00\x1a\xe1\x02\n\x0cSearchParams\x12\x1a\n\x12max_return_results\x18\x01 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12L\n\nboost_spec\x18\x03 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12m\n\x12search_result_mode\x18\x05 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12V\n\x10\x64\x61ta_store_specs\x18\x07 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec\x1a\x87\x0c\n\x10SearchResultList\x12t\n\x0esearch_results\x18\x01 \x03(\x0b\x32\\.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult\x1a\xfc\n\n\x0cSearchResult\x12\x9b\x01\n\x1aunstructured_document_info\x18\x01 \x01(\x0b\x32u.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfoH\x00\x12|\n\nchunk_info\x18\x02 \x01(\x0b\x32\x66.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfoH\x00\x1a\xa6\x06\n\x18UnstructuredDocumentInfo\x12>\n\x08\x64ocument\x18\x01 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\xa1\x01\n\x11\x64ocument_contexts\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext\x12\xa5\x01\n\x13\x65xtractive_segments\x18\x05 \x03(\x0b\x32\x87\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment\x12\xa7\x01\n\x12\x65xtractive_answers\x18\x06 \x03(\x0b\x32\x86\x01.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswerB\x02\x18\x01\x1a;\n\x0f\x44ocumentContext\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a=\n\x11\x45xtractiveSegment\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a<\n\x10\x45xtractiveAnswer\x12\x17\n\x0fpage_identifier\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x1a\x9b\x02\n\tChunkInfo\x12\x38\n\x05\x63hunk\x18\x01 \x01(\tB)\xfa\x41&\n$discoveryengine.googleapis.com/Chunk\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\x12\x92\x01\n\x11\x64ocument_metadata\x18\x04 \x01(\x0b\x32w.google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata\x1a.\n\x10\x44ocumentMetadata\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\tB\t\n\x07\x63ontentB\x07\n\x05input\x1a\xae\x08\n\x16QueryUnderstandingSpec\x12\x85\x01\n\x19query_classification_spec\x18\x01 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec\x12{\n\x14query_rephraser_spec\x18\x02 \x01(\x0b\x32].google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec\x12%\n\x18\x64isable_spell_correction\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xc6\x02\n\x17QueryClassificationSpec\x12v\n\x05types\x18\x01 \x03(\x0e\x32g.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type\"\xb2\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44VERSARIAL_QUERY\x10\x01\x12\x1c\n\x18NON_ANSWER_SEEKING_QUERY\x10\x02\x12\x17\n\x13JAIL_BREAKING_QUERY\x10\x03\x12\x1f\n\x1bNON_ANSWER_SEEKING_QUERY_V2\x10\x04\x12%\n!USER_DEFINED_CLASSIFICATION_QUERY\x10\x05\x1a\x9e\x03\n\x12QueryRephraserSpec\x12\x0f\n\x07\x64isable\x18\x01 \x01(\x08\x12\x1a\n\x12max_rephrase_steps\x18\x02 \x01(\x05\x12\x80\x01\n\nmodel_spec\x18\x03 \x01(\x0b\x32g.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpecB\x03\xe0\x41\x01\x1a\xd7\x01\n\tModelSpec\x12\x8a\x01\n\nmodel_type\x18\x01 \x01(\x0e\x32q.google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec.ModelTypeB\x03\xe0\x41\x01\"=\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SMALL\x10\x01\x12\t\n\x05LARGE\x10\x02\x1a\xd8\x03\n\x0b\x45ndUserSpec\x12o\n\x11\x65nd_user_metadata\x18\x01 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaDataB\x03\xe0\x41\x01\x1a\xd7\x02\n\x0f\x45ndUserMetaData\x12o\n\nchunk_info\x18\x01 \x01(\x0b\x32Y.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfoH\x00\x1a\xc7\x01\n\tChunkInfo\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x85\x01\n\x11\x64ocument_metadata\x18\x02 \x01(\x0b\x32j.google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo.DocumentMetadata\x1a!\n\x10\x44ocumentMetadata\x12\r\n\x05title\x18\x01 \x01(\tB\t\n\x07\x63ontent\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa5\x01\n\x13\x41nswerQueryResponse\x12\x37\n\x06\x61nswer\x18\x01 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Answer\x12\x39\n\x07session\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.Session\x12\x1a\n\x12\x61nswer_query_token\x18\x03 \x01(\t\"O\n\x10GetAnswerRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Answer\"\x98\x01\n\x14\x43reateSessionRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12>\n\x07session\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SessionB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateSessionRequest\x12>\n\x07session\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SessionB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"T\n\x14\x44\x65leteSessionRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Session\"v\n\x11GetSessionRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12#\n\x16include_answer_details\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\xa0\x01\n\x13ListSessionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"k\n\x14ListSessionsResponse\x12:\n\x08sessions\x18\x01 \x03(\x0b\x32(.google.cloud.discoveryengine.v1.Session\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x96+\n\x1b\x43onversationalSearchService\x12\xab\x03\n\x14\x43onverseConversation\x12<.google.cloud.discoveryengine.v1.ConverseConversationRequest\x1a=.google.cloud.discoveryengine.v1.ConverseConversationResponse\"\x95\x02\xda\x41\nname,query\x82\xd3\xe4\x93\x02\x81\x02\"G/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}:converse:\x01*ZZ\"U/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse:\x01*ZW\"R/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}:converse:\x01*\x12\xa6\x03\n\x12\x43reateConversation\x12:.google.cloud.discoveryengine.v1.CreateConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xa4\x02\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02\x87\x02\">/v1/{parent=projects/*/locations/*/dataStores/*}/conversations:\x0c\x63onversationZ\\\"L/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations:\x0c\x63onversationZY\"I/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations:\x0c\x63onversation\x12\xd6\x02\n\x12\x44\x65leteConversation\x12:.google.cloud.discoveryengine.v1.DeleteConversationRequest\x1a\x16.google.protobuf.Empty\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01*>/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}ZN*L/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}ZK*I/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}\x12\xd2\x03\n\x12UpdateConversation\x12:.google.cloud.discoveryengine.v1.UpdateConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xd0\x02\xda\x41\x18\x63onversation,update_mask\x82\xd3\xe4\x93\x02\xae\x02\x32K/v1/{conversation.name=projects/*/locations/*/dataStores/*/conversations/*}:\x0c\x63onversationZi2Y/v1/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:\x0c\x63onversationZf2V/v1/{conversation.name=projects/*/locations/*/collections/*/engines/*/conversations/*}:\x0c\x63onversation\x12\xe7\x02\n\x0fGetConversation\x12\x37.google.cloud.discoveryengine.v1.GetConversationRequest\x1a-.google.cloud.discoveryengine.v1.Conversation\"\xeb\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xdd\x01\x12>/v1/{name=projects/*/locations/*/dataStores/*/conversations/*}ZN\x12L/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}ZK\x12I/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}\x12\xfa\x02\n\x11ListConversations\x12\x39.google.cloud.discoveryengine.v1.ListConversationsRequest\x1a:.google.cloud.discoveryengine.v1.ListConversationsResponse\"\xed\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xdd\x01\x12>/v1/{parent=projects/*/locations/*/dataStores/*}/conversationsZN\x12L/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversationsZK\x12I/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations\x12\x9e\x03\n\x0b\x41nswerQuery\x12\x33.google.cloud.discoveryengine.v1.AnswerQueryRequest\x1a\x34.google.cloud.discoveryengine.v1.AnswerQueryResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:answer:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:answer:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:answer:\x01*\x12\xb8\x03\n\x11StreamAnswerQuery\x12\x33.google.cloud.discoveryengine.v1.AnswerQueryRequest\x1a\x34.google.cloud.discoveryengine.v1.AnswerQueryResponse\"\xb5\x02\x82\xd3\xe4\x93\x02\xae\x02\"V/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:streamAnswer:\x01*Zi\"d/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:streamAnswer:\x01*Zf\"a/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:streamAnswer:\x01*0\x01\x12\xe4\x02\n\tGetAnswer\x12\x31.google.cloud.discoveryengine.v1.GetAnswerRequest\x1a\'.google.cloud.discoveryengine.v1.Answer\"\xfa\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xec\x01\x12\x43/v1/{name=projects/*/locations/*/dataStores/*/sessions/*/answers/*}ZS\x12Q/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*/answers/*}ZP\x12N/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*/answers/*}\x12\xf4\x02\n\rCreateSession\x12\x35.google.cloud.discoveryengine.v1.CreateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x81\x02\xda\x41\x0eparent,session\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/sessions:\x07sessionZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions:\x07sessionZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions:\x07session\x12\xbd\x02\n\rDeleteSession\x12\x35.google.cloud.discoveryengine.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\x91\x03\n\rUpdateSession\x12\x35.google.cloud.discoveryengine.v1.UpdateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x9e\x02\xda\x41\x13session,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{session.name=projects/*/locations/*/dataStores/*/sessions/*}:\x07sessionZZ2O/v1/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}:\x07sessionZW2L/v1/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}:\x07session\x12\xc9\x02\n\nGetSession\x12\x32.google.cloud.discoveryengine.v1.GetSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\xdc\x02\n\x0cListSessions\x12\x34.google.cloud.discoveryengine.v1.ListSessionsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListSessionsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/sessionsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessionsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n#com.google.cloud.discoveryengine.v1B ConversationalSearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.TextInput", "google/cloud/discoveryengine/v1/conversation.proto"], - ["google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec", "google/cloud/discoveryengine/v1/search_service.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.discoveryengine.v1.Query", "google/cloud/discoveryengine/v1/session.proto"], - ["google.cloud.discoveryengine.v1.Answer", "google/cloud/discoveryengine/v1/answer.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - ConverseConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConverseConversationRequest").msgclass - ConverseConversationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ConverseConversationResponse").msgclass - CreateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateConversationRequest").msgclass - UpdateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateConversationRequest").msgclass - DeleteConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteConversationRequest").msgclass - GetConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetConversationRequest").msgclass - ListConversationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListConversationsRequest").msgclass - ListConversationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListConversationsResponse").msgclass - AnswerQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest").msgclass - AnswerQueryRequest::SafetySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec").msgclass - AnswerQueryRequest::SafetySpec::SafetySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting").msgclass - AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SafetySpec.SafetySetting.HarmBlockThreshold").enummodule - AnswerQueryRequest::RelatedQuestionsSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.RelatedQuestionsSpec").msgclass - AnswerQueryRequest::GroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec").msgclass - AnswerQueryRequest::GroundingSpec::FilteringLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.GroundingSpec.FilteringLevel").enummodule - AnswerQueryRequest::AnswerGenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec").msgclass - AnswerQueryRequest::AnswerGenerationSpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec").msgclass - AnswerQueryRequest::AnswerGenerationSpec::PromptSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec").msgclass - AnswerQueryRequest::SearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec").msgclass - AnswerQueryRequest::SearchSpec::SearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchParams").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.DocumentContext").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveSegment").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.UnstructuredDocumentInfo.ExtractiveAnswer").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo").msgclass - AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.SearchSpec.SearchResultList.SearchResult.ChunkInfo.DocumentMetadata").msgclass - AnswerQueryRequest::QueryUnderstandingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec").msgclass - AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec").msgclass - AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryClassificationSpec.Type").enummodule - AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec").msgclass - AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec").msgclass - AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.ModelSpec.ModelType").enummodule - AnswerQueryRequest::EndUserSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec").msgclass - AnswerQueryRequest::EndUserSpec::EndUserMetaData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData").msgclass - AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo").msgclass - AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryRequest.EndUserSpec.EndUserMetaData.ChunkInfo.DocumentMetadata").msgclass - AnswerQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AnswerQueryResponse").msgclass - GetAnswerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetAnswerRequest").msgclass - CreateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSessionRequest").msgclass - UpdateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateSessionRequest").msgclass - DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSessionRequest").msgclass - GetSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetSessionRequest").msgclass - ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListSessionsRequest").msgclass - ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListSessionsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb deleted file mode 100644 index cdc17b9d151c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +++ /dev/null @@ -1,100 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/conversational_search_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/conversational_search_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ConversationalSearchService - # Service for conversational search. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.ConversationalSearchService' - - # Converses a conversation. - rpc :ConverseConversation, ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse - # Creates a Conversation. - # - # If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to - # create already exists, an ALREADY_EXISTS error is returned. - rpc :CreateConversation, ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation - # Deletes a Conversation. - # - # If the [Conversation][google.cloud.discoveryengine.v1.Conversation] to - # delete does not exist, a NOT_FOUND error is returned. - rpc :DeleteConversation, ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, ::Google::Protobuf::Empty - # Updates a Conversation. - # - # [Conversation][google.cloud.discoveryengine.v1.Conversation] action type - # cannot be changed. If the - # [Conversation][google.cloud.discoveryengine.v1.Conversation] to update does - # not exist, a NOT_FOUND error is returned. - rpc :UpdateConversation, ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation - # Gets a Conversation. - rpc :GetConversation, ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, ::Google::Cloud::DiscoveryEngine::V1::Conversation - # Lists all Conversations by their parent - # [DataStore][google.cloud.discoveryengine.v1.DataStore]. - rpc :ListConversations, ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse - # Answer query method. - rpc :AnswerQuery, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse - # Answer query method (streaming). - # - # It takes one - # [AnswerQueryRequest][google.cloud.discoveryengine.v1.AnswerQueryRequest] - # and returns multiple - # [AnswerQueryResponse][google.cloud.discoveryengine.v1.AnswerQueryResponse] - # messages in a stream. - rpc :StreamAnswerQuery, ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, stream(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse) - # Gets a Answer. - rpc :GetAnswer, ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Google::Cloud::DiscoveryEngine::V1::Answer - # Creates a Session. - # - # If the [Session][google.cloud.discoveryengine.v1.Session] to create already - # exists, an ALREADY_EXISTS error is returned. - rpc :CreateSession, ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Deletes a Session. - # - # If the [Session][google.cloud.discoveryengine.v1.Session] to delete does - # not exist, a NOT_FOUND error is returned. - rpc :DeleteSession, ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Google::Protobuf::Empty - # Updates a Session. - # - # [Session][google.cloud.discoveryengine.v1.Session] action type cannot be - # changed. If the [Session][google.cloud.discoveryengine.v1.Session] to - # update does not exist, a NOT_FOUND error is returned. - rpc :UpdateSession, ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Gets a Session. - rpc :GetSession, ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Lists all Sessions by their parent - # [DataStore][google.cloud.discoveryengine.v1.DataStore]. - rpc :ListSessions, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb deleted file mode 100644 index 99d68865780f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/custom_tuning_model_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/custom_tuning_model.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n9google/cloud/discoveryengine/v1/custom_tuning_model.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcd\x07\n\x11\x43ustomTuningModel\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0discoveryengine.googleapis.com/CustomTuningModel\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rmodel_version\x18\x03 \x01(\x03\x12R\n\x0bmodel_state\x18\x04 \x01(\x0e\x32=.google.cloud.discoveryengine.v1.CustomTuningModel.ModelState\x12\x33\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x37\n\x13training_start_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12P\n\x07metrics\x18\x07 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.CustomTuningModel.MetricsEntry\x12\x15\n\rerror_message\x18\x08 \x01(\t\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"\xc0\x01\n\nModelState\x12\x1b\n\x17MODEL_STATE_UNSPECIFIED\x10\x00\x12\x13\n\x0fTRAINING_PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x12\x15\n\x11TRAINING_COMPLETE\x10\x03\x12\x15\n\x11READY_FOR_SERVING\x10\x04\x12\x13\n\x0fTRAINING_FAILED\x10\x05\x12\x12\n\x0eNO_IMPROVEMENT\x10\x06\x12\x1b\n\x17INPUT_VALIDATION_FAILED\x10\x07:\xa4\x02\xea\x41\xa0\x02\n0discoveryengine.googleapis.com/CustomTuningModel\x12hprojects/{project}/locations/{location}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}\x12\x81\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}B\x89\x02\n#com.google.cloud.discoveryengine.v1B\x16\x43ustomTuningModelProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - CustomTuningModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomTuningModel").msgclass - CustomTuningModel::ModelState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CustomTuningModel.ModelState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb deleted file mode 100644 index 069619b9b2a9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/data_store.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' -require 'google/cloud/discoveryengine/v1/common_pb' -require 'google/cloud/discoveryengine/v1/document_processing_config_pb' -require 'google/cloud/discoveryengine/v1/schema_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/discoveryengine/v1/data_store.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/cmek_config_service.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a@google/cloud/discoveryengine/v1/document_processing_config.proto\x1a,google/cloud/discoveryengine/v1/schema.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xec\x0e\n\tDataStore\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x03 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x05\x12\x45\n\x0esolution_types\x18\x05 \x03(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionType\x12\x1e\n\x11\x64\x65\x66\x61ult_schema_id\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12U\n\x0e\x63ontent_config\x18\x06 \x01(\x0e\x32\x38.google.cloud.discoveryengine.v1.DataStore.ContentConfigB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x63\n\x1b\x61\x64vanced_site_search_config\x18\x0c \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.AdvancedSiteSearchConfigB\x03\xe0\x41\x01\x12\x82\x01\n+natural_language_query_understanding_config\x18\" \x01(\x0b\x32H.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfigB\x03\xe0\x41\x01\x12\x19\n\x0ckms_key_name\x18 \x01(\tB\x03\xe0\x41\x04\x12\x45\n\x0b\x63mek_config\x18\x12 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.CmekConfigB\x03\xe0\x41\x03\x12]\n\x12\x62illing_estimation\x18\x17 \x01(\x0b\x32<.google.cloud.discoveryengine.v1.DataStore.BillingEstimationB\x03\xe0\x41\x03\x12\x18\n\x0b\x61\x63l_enabled\x18\x18 \x01(\x08\x42\x03\xe0\x41\x05\x12J\n\x10workspace_config\x18\x19 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.WorkspaceConfig\x12]\n\x1a\x64ocument_processing_config\x18\x1b \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.DocumentProcessingConfig\x12@\n\x0fstarting_schema\x18\x1c \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.Schema\x12Z\n\x16healthcare_fhir_config\x18\x1d \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.HealthcareFhirConfigB\x03\xe0\x41\x01\x12[\n\x16identity_mapping_store\x18\x1f \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3discoveryengine.googleapis.com/IdentityMappingStore\x1a\xae\x02\n\x11\x42illingEstimation\x12\x1c\n\x14structured_data_size\x18\x01 \x01(\x03\x12\x1e\n\x16unstructured_data_size\x18\x02 \x01(\x03\x12\x19\n\x11website_data_size\x18\x03 \x01(\x03\x12?\n\x1bstructured_data_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x1dunstructured_data_update_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x18website_data_update_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x7f\n\rContentConfig\x12\x1e\n\x1a\x43ONTENT_CONFIG_UNSPECIFIED\x10\x00\x12\x0e\n\nNO_CONTENT\x10\x01\x12\x14\n\x10\x43ONTENT_REQUIRED\x10\x02\x12\x12\n\x0ePUBLIC_WEBSITE\x10\x03\x12\x14\n\x10GOOGLE_WORKSPACE\x10\x04:\xc9\x01\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12?projects/{project}/locations/{location}/dataStores/{data_store}\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\"\x9e\x01\n\x18\x41\x64vancedSiteSearchConfig\x12\"\n\x15\x64isable_initial_index\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12&\n\x19\x64isable_automatic_refresh\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x18\n\x16_disable_initial_indexB\x1c\n\x1a_disable_automatic_refresh\"\xbf\x01\n\'NaturalLanguageQueryUnderstandingConfig\x12[\n\x04mode\x18\x01 \x01(\x0e\x32M.google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode\"7\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"\xf5\x02\n\x0fWorkspaceConfig\x12\x43\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.WorkspaceConfig.Type\x12\x1a\n\x12\x64\x61sher_customer_id\x18\x02 \x01(\t\x12(\n\x1bsuper_admin_service_account\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12&\n\x19super_admin_email_address\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_DRIVE\x10\x01\x12\x0f\n\x0bGOOGLE_MAIL\x10\x02\x12\x10\n\x0cGOOGLE_SITES\x10\x03\x12\x13\n\x0fGOOGLE_CALENDAR\x10\x04\x12\x0f\n\x0bGOOGLE_CHAT\x10\x05\x12\x11\n\rGOOGLE_GROUPS\x10\x06\x12\x0f\n\x0bGOOGLE_KEEP\x10\x07\x12\x11\n\rGOOGLE_PEOPLE\x10\x08\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0e\x44\x61taStoreProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.CmekConfig", "google/cloud/discoveryengine/v1/cmek_config_service.proto"], - ["google.cloud.discoveryengine.v1.DocumentProcessingConfig", "google/cloud/discoveryengine/v1/document_processing_config.proto"], - ["google.cloud.discoveryengine.v1.Schema", "google/cloud/discoveryengine/v1/schema.proto"], - ["google.cloud.discoveryengine.v1.HealthcareFhirConfig", "google/cloud/discoveryengine/v1/common.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - DataStore = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore").msgclass - DataStore::BillingEstimation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.BillingEstimation").msgclass - DataStore::ContentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DataStore.ContentConfig").enummodule - AdvancedSiteSearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AdvancedSiteSearchConfig").msgclass - NaturalLanguageQueryUnderstandingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig").msgclass - NaturalLanguageQueryUnderstandingConfig::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.NaturalLanguageQueryUnderstandingConfig.Mode").enummodule - WorkspaceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig").msgclass - WorkspaceConfig::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WorkspaceConfig.Type").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb deleted file mode 100644 index 2a40be456b65..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/data_store_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/data_store_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n8google/cloud/discoveryengine/v1/data_store_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/discoveryengine/v1/data_store.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x02\n\x16\x43reateDataStoreRequest\x12J\n\x10\x63mek_config_name\x18\x05 \x01(\tB.\xfa\x41+\n)discoveryengine.googleapis.com/CmekConfigH\x00\x12\x16\n\x0c\x64isable_cmek\x18\x06 \x01(\x08H\x00\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x43\n\ndata_store\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.DataStoreB\x03\xe0\x41\x02\x12\x1a\n\rdata_store_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12#\n\x1b\x63reate_advanced_site_search\x18\x04 \x01(\x08\x12$\n\x1cskip_default_schema_creation\x18\x07 \x01(\x08\x42\x0e\n\x0c\x63mek_options\"U\n\x13GetDataStoreRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"{\n\x17\x43reateDataStoreMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x91\x01\n\x15ListDataStoresRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"r\n\x16ListDataStoresResponse\x12?\n\x0b\x64\x61ta_stores\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.DataStore\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x16\x44\x65leteDataStoreRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"\x8e\x01\n\x16UpdateDataStoreRequest\x12\x43\n\ndata_store\x18\x01 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.DataStoreB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"{\n\x17\x44\x65leteDataStoreMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xdd\x0c\n\x10\x44\x61taStoreService\x12\x84\x03\n\x0f\x43reateDataStore\x12\x37.google.cloud.discoveryengine.v1.CreateDataStoreRequest\x1a\x1d.google.longrunning.Operation\"\x98\x02\xca\x41\x64\n)google.cloud.discoveryengine.v1.DataStore\x12\x37google.cloud.discoveryengine.v1.CreateDataStoreMetadata\xda\x41\x1fparent,data_store,data_store_id\x82\xd3\xe4\x93\x02\x88\x01\"./v1/{parent=projects/*/locations/*}/dataStores:\ndata_storeZJ\"\x12\x12*\n\nprincipals\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.Principal\x12\x10\n\x08idp_wide\x18\x02 \x01(\x08\x1a\x86\x01\n\x0bIndexStatus\x12.\n\nindex_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12\x1c\n\x0fpending_message\x18\x03 \x01(\tB\x03\xe0\x41\x05:\x96\x02\xea\x41\x92\x02\n\'discoveryengine.googleapis.com/Document\x12\x66projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}\x12\x7fprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}B\x06\n\x04\x64\x61taB\x80\x02\n#com.google.cloud.discoveryengine.v1B\rDocumentProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Struct", "google/protobuf/struct.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.Principal", "google/cloud/discoveryengine/v1/common.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document").msgclass - Document::Content = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.Content").msgclass - Document::AclInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.AclInfo").msgclass - Document::AclInfo::AccessRestriction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.AclInfo.AccessRestriction").msgclass - Document::IndexStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Document.IndexStatus").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb deleted file mode 100644 index da24f28e1803..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/document_processing_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n@google/cloud/discoveryengine/v1/document_processing_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x84\x0e\n\x18\x44ocumentProcessingConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x61\n\x0f\x63hunking_config\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig\x12g\n\x16\x64\x65\x66\x61ult_parsing_config\x18\x04 \x01(\x0b\x32G.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig\x12w\n\x18parsing_config_overrides\x18\x05 \x03(\x0b\x32U.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfigOverridesEntry\x1a\xff\x01\n\x0e\x43hunkingConfig\x12\x8a\x01\n\x1clayout_based_chunking_config\x18\x01 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig.LayoutBasedChunkingConfigH\x00\x1aR\n\x19LayoutBasedChunkingConfig\x12\x12\n\nchunk_size\x18\x01 \x01(\x05\x12!\n\x19include_ancestor_headings\x18\x02 \x01(\x08\x42\x0c\n\nchunk_mode\x1a\xfc\x05\n\rParsingConfig\x12~\n\x16\x64igital_parsing_config\x18\x01 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfigH\x00\x12v\n\x12ocr_parsing_config\x18\x02 \x01(\x0b\x32X.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfigH\x00\x12|\n\x15layout_parsing_config\x18\x03 \x01(\x0b\x32[.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.LayoutParsingConfigH\x00\x1a\x16\n\x14\x44igitalParsingConfig\x1aS\n\x10OcrParsingConfig\x12&\n\x1a\x65nhanced_document_elements\x18\x01 \x03(\tB\x02\x18\x01\x12\x17\n\x0fuse_native_text\x18\x02 \x01(\x08\x1a\xee\x01\n\x13LayoutParsingConfig\x12$\n\x17\x65nable_table_annotation\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12$\n\x17\x65nable_image_annotation\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12%\n\x18structured_content_types\x18\t \x03(\tB\x03\xe0\x41\x01\x12\"\n\x15\x65xclude_html_elements\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14\x65xclude_html_classes\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65xclude_html_ids\x18\x0c \x03(\tB\x03\xe0\x41\x01\x42\x17\n\x15type_dedicated_config\x1a\x86\x01\n\x1bParsingConfigOverridesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12V\n\x05value\x18\x02 \x01(\x0b\x32G.google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig:\x02\x38\x01:\x8a\x02\xea\x41\x86\x02\n7discoveryengine.googleapis.com/DocumentProcessingConfig\x12Xprojects/{project}/locations/{location}/dataStores/{data_store}/documentProcessingConfig\x12qprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfigB\x90\x02\n#com.google.cloud.discoveryengine.v1B\x1d\x44ocumentProcessingConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - DocumentProcessingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig").msgclass - DocumentProcessingConfig::ChunkingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig").msgclass - DocumentProcessingConfig::ChunkingConfig::LayoutBasedChunkingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ChunkingConfig.LayoutBasedChunkingConfig").msgclass - DocumentProcessingConfig::ParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig").msgclass - DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.DigitalParsingConfig").msgclass - DocumentProcessingConfig::ParsingConfig::OcrParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.OcrParsingConfig").msgclass - DocumentProcessingConfig::ParsingConfig::LayoutParsingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentProcessingConfig.ParsingConfig.LayoutParsingConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb deleted file mode 100644 index 91fa7896d220..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/document_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/document_pb' -require 'google/cloud/discoveryengine/v1/import_config_pb' -require 'google/cloud/discoveryengine/v1/purge_config_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n6google/cloud/discoveryengine/v1/document_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"S\n\x12GetDocumentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"|\n\x14ListDocumentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x15ListDocumentsResponse\x12<\n\tdocuments\x18\x01 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb2\x01\n\x15\x43reateDocumentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12@\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\x12\x18\n\x0b\x64ocument_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa1\x01\n\x15UpdateDocumentRequest\x12@\n\x08\x64ocument\x18\x01 \x01(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\x12\x15\n\rallow_missing\x18\x02 \x01(\x08\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"V\n\x15\x44\x65leteDocumentRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"\x9b\x04\n BatchGetDocumentsMetadataRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12_\n\x07matcher\x18\x02 \x01(\x0b\x32I.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.MatcherB\x03\xe0\x41\x02\x1a\x1b\n\x0bUrisMatcher\x12\x0c\n\x04uris\x18\x01 \x03(\t\x1aU\n\x0b\x46hirMatcher\x12\x46\n\x0e\x66hir_resources\x18\x01 \x03(\tB.\xe0\x41\x02\xfa\x41(\n&healthcare.googleapis.com/FhirResource\x1a\xe2\x01\n\x07Matcher\x12\x65\n\x0curis_matcher\x18\x01 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.UrisMatcherH\x00\x12\x65\n\x0c\x66hir_matcher\x18\x02 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcherH\x00\x42\t\n\x07matcher\"\xa0\x05\n!BatchGetDocumentsMetadataResponse\x12o\n\x12\x64ocuments_metadata\x18\x01 \x03(\x0b\x32S.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata\x1a\xb2\x03\n\x10\x44ocumentMetadata\x12w\n\rmatcher_value\x18\x02 \x01(\x0b\x32`.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata.MatcherValue\x12W\n\x05state\x18\x03 \x01(\x0e\x32H.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.State\x12\x37\n\x13last_refreshed_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1d\n\x15\x64\x61ta_ingestion_source\x18\x05 \x01(\t\x1at\n\x0cMatcherValue\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x44\n\rfhir_resource\x18\x02 \x01(\tB+\xfa\x41(\n&healthcare.googleapis.com/FhirResourceH\x00\x42\x0f\n\rmatcher_value\"U\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INDEXED\x10\x01\x12\x16\n\x12NOT_IN_TARGET_SITE\x10\x02\x12\x10\n\x0cNOT_IN_INDEX\x10\x03\x32\x9d\x16\n\x0f\x44ocumentService\x12\x9c\x02\n\x0bGetDocument\x12\x33.google.cloud.discoveryengine.v1.GetDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01\x12\x45/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}ZU\x12S/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}\x12\xaf\x02\n\rListDocuments\x12\x35.google.cloud.discoveryengine.v1.ListDocumentsRequest\x1a\x36.google.cloud.discoveryengine.v1.ListDocumentsResponse\"\xae\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x9e\x01\x12\x45/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documentsZU\x12S/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents\x12\xcd\x02\n\x0e\x43reateDocument\x12\x36.google.cloud.discoveryengine.v1.CreateDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xd7\x01\xda\x41\x1bparent,document,document_id\x82\xd3\xe4\x93\x02\xb2\x01\"E/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:\x08\x64ocumentZ_\"S/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:\x08\x64ocument\x12\xd8\x02\n\x0eUpdateDocument\x12\x36.google.cloud.discoveryengine.v1.UpdateDocumentRequest\x1a).google.cloud.discoveryengine.v1.Document\"\xe2\x01\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\xc4\x01\x32N/v1/{document.name=projects/*/locations/*/dataStores/*/branches/*/documents/*}:\x08\x64ocumentZh2\\/v1/{document.name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}:\x08\x64ocument\x12\x8f\x02\n\x0e\x44\x65leteDocument\x12\x36.google.cloud.discoveryengine.v1.DeleteDocumentRequest\x1a\x16.google.protobuf.Empty\"\xac\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x9e\x01*E/v1/{name=projects/*/locations/*/dataStores/*/branches/*/documents/*}ZU*S/v1/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*}\x12\x9a\x03\n\x0fImportDocuments\x12\x37.google.cloud.discoveryengine.v1.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xae\x02\xca\x41r\n7google.cloud.discoveryengine.v1.ImportDocumentsResponse\x12\x37google.cloud.discoveryengine.v1.ImportDocumentsMetadata\x82\xd3\xe4\x93\x02\xb2\x01\"L/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:import:\x01*Z_\"Z/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:import:\x01*\x12\x94\x03\n\x0ePurgeDocuments\x12\x36.google.cloud.discoveryengine.v1.PurgeDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xaa\x02\xca\x41p\n6google.cloud.discoveryengine.v1.PurgeDocumentsResponse\x12\x36google.cloud.discoveryengine.v1.PurgeDocumentsMetadata\x82\xd3\xe4\x93\x02\xb0\x01\"K/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge:\x01*Z^\"Y/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/documents:purge:\x01*\x12\xf3\x02\n\x19\x42\x61tchGetDocumentsMetadata\x12\x41.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest\x1a\x42.google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse\"\xce\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbe\x01\x12U/v1/{parent=projects/*/locations/*/dataStores/*/branches/*}/batchGetDocumentsMetadataZe\x12\x63/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/branches/*}/batchGetDocumentsMetadata\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x87\x02\n#com.google.cloud.discoveryengine.v1B\x14\x44ocumentServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetDocumentRequest").msgclass - ListDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListDocumentsRequest").msgclass - ListDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListDocumentsResponse").msgclass - CreateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateDocumentRequest").msgclass - UpdateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateDocumentRequest").msgclass - DeleteDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteDocumentRequest").msgclass - BatchGetDocumentsMetadataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest").msgclass - BatchGetDocumentsMetadataRequest::UrisMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.UrisMatcher").msgclass - BatchGetDocumentsMetadataRequest::FhirMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.FhirMatcher").msgclass - BatchGetDocumentsMetadataRequest::Matcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataRequest.Matcher").msgclass - BatchGetDocumentsMetadataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse").msgclass - BatchGetDocumentsMetadataResponse::DocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata").msgclass - BatchGetDocumentsMetadataResponse::DocumentMetadata::MatcherValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.DocumentMetadata.MatcherValue").msgclass - BatchGetDocumentsMetadataResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchGetDocumentsMetadataResponse.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb deleted file mode 100644 index 4a36bd787832..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/document_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/document_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module DocumentService - # Service for ingesting [Document][google.cloud.discoveryengine.v1.Document] - # information of the customer's website. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.DocumentService' - - # Gets a [Document][google.cloud.discoveryengine.v1.Document]. - rpc :GetDocument, ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document - # Gets a list of [Document][google.cloud.discoveryengine.v1.Document]s. - rpc :ListDocuments, ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse - # Creates a [Document][google.cloud.discoveryengine.v1.Document]. - rpc :CreateDocument, ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document - # Updates a [Document][google.cloud.discoveryengine.v1.Document]. - rpc :UpdateDocument, ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, ::Google::Cloud::DiscoveryEngine::V1::Document - # Deletes a [Document][google.cloud.discoveryengine.v1.Document]. - rpc :DeleteDocument, ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, ::Google::Protobuf::Empty - # Bulk import of multiple - # [Document][google.cloud.discoveryengine.v1.Document]s. Request processing - # may be synchronous. Non-existing items are created. - # - # Note: It is possible for a subset of the - # [Document][google.cloud.discoveryengine.v1.Document]s to be successfully - # updated. - rpc :ImportDocuments, ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, ::Google::Longrunning::Operation - # Permanently deletes all selected - # [Document][google.cloud.discoveryengine.v1.Document]s in a branch. - # - # This process is asynchronous. Depending on the number of - # [Document][google.cloud.discoveryengine.v1.Document]s to be deleted, this - # operation can take hours to complete. Before the delete operation - # completes, some [Document][google.cloud.discoveryengine.v1.Document]s might - # still be returned by - # [DocumentService.GetDocument][google.cloud.discoveryengine.v1.DocumentService.GetDocument] - # or - # [DocumentService.ListDocuments][google.cloud.discoveryengine.v1.DocumentService.ListDocuments]. - # - # To get a list of the [Document][google.cloud.discoveryengine.v1.Document]s - # to be deleted, set - # [PurgeDocumentsRequest.force][google.cloud.discoveryengine.v1.PurgeDocumentsRequest.force] - # to false. - rpc :PurgeDocuments, ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, ::Google::Longrunning::Operation - # Gets index freshness metadata for - # [Document][google.cloud.discoveryengine.v1.Document]s. Supported for - # website search only. - rpc :BatchGetDocumentsMetadata, ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb deleted file mode 100644 index 3f1bef602c6d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/engine.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/discoveryengine/v1/engine.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe1\x14\n\x06\x45ngine\x12V\n\x12\x63hat_engine_config\x18\x0b \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.Engine.ChatEngineConfigH\x00\x12Z\n\x14search_engine_config\x18\r \x01(\x0b\x32:.google.cloud.discoveryengine.v1.Engine.SearchEngineConfigH\x00\x12u\n\"media_recommendation_engine_config\x18\x0e \x01(\x0b\x32G.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfigH\x00\x12_\n\x14\x63hat_engine_metadata\x18\x0c \x01(\x0b\x32:.google.cloud.discoveryengine.v1.Engine.ChatEngineMetadataB\x03\xe0\x41\x03H\x01\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0e\x64\x61ta_store_ids\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12I\n\rsolution_type\x18\x06 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x03\xe0\x41\x02\x12Q\n\x11industry_vertical\x18\x10 \x01(\x0e\x32\x31.google.cloud.discoveryengine.v1.IndustryVerticalB\x03\xe0\x41\x01\x12K\n\rcommon_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.discoveryengine.v1.Engine.CommonConfig\x12\x1e\n\x11\x64isable_analytics\x18\x1a \x01(\x08\x42\x03\xe0\x41\x01\x1a\x9c\x01\n\x12SearchEngineConfig\x12@\n\x0bsearch_tier\x18\x01 \x01(\x0e\x32+.google.cloud.discoveryengine.v1.SearchTier\x12\x44\n\x0esearch_add_ons\x18\x02 \x03(\x0e\x32,.google.cloud.discoveryengine.v1.SearchAddOn\x1a\xb6\x08\n\x1fMediaRecommendationEngineConfig\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x16optimization_objective\x18\x02 \x01(\t\x12\x8a\x01\n\x1doptimization_objective_config\x18\x03 \x01(\x0b\x32\x63.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.OptimizationObjectiveConfig\x12m\n\x0etraining_state\x18\x04 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.TrainingState\x12\x81\x01\n\x16\x65ngine_features_config\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.EngineFeaturesConfigB\x03\xe0\x41\x01\x1a_\n\x1bOptimizationObjectiveConfig\x12\x19\n\x0ctarget_field\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12%\n\x18target_field_value_float\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\x1a\xbf\x02\n\x14\x45ngineFeaturesConfig\x12\x8c\x01\n\x1arecommended_for_you_config\x18\x01 \x01(\x0b\x32\x66.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.RecommendedForYouFeatureConfigH\x00\x12\x7f\n\x13most_popular_config\x18\x02 \x01(\x0b\x32`.google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.MostPopularFeatureConfigH\x00\x42\x17\n\x15type_dedicated_config\x1a<\n\x1eRecommendedForYouFeatureConfig\x12\x1a\n\x12\x63ontext_event_type\x18\x01 \x01(\t\x1a\x34\n\x18MostPopularFeatureConfig\x12\x18\n\x10time_window_days\x18\x01 \x01(\x03\"I\n\rTrainingState\x12\x1e\n\x1aTRAINING_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06PAUSED\x10\x01\x12\x0c\n\x08TRAINING\x10\x02\x1a\xb4\x02\n\x10\x43hatEngineConfig\x12k\n\x15\x61gent_creation_config\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.Engine.ChatEngineConfig.AgentCreationConfig\x12 \n\x18\x64ialogflow_agent_to_link\x18\x02 \x01(\t\x12\x1f\n\x12\x61llow_cross_region\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1ap\n\x13\x41gentCreationConfig\x12\x10\n\x08\x62usiness\x18\x01 \x01(\t\x12\x1d\n\x15\x64\x65\x66\x61ult_language_code\x18\x02 \x01(\t\x12\x16\n\ttime_zone\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x08location\x18\x04 \x01(\t\x1a$\n\x0c\x43ommonConfig\x12\x14\n\x0c\x63ompany_name\x18\x01 \x01(\t\x1a.\n\x12\x43hatEngineMetadata\x12\x18\n\x10\x64ialogflow_agent\x18\x01 \x01(\t:}\xea\x41z\n%discoveryengine.googleapis.com/Engine\x12Qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}B\x0f\n\rengine_configB\x11\n\x0f\x65ngine_metadataB\xfe\x01\n#com.google.cloud.discoveryengine.v1B\x0b\x45ngineProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Engine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine").msgclass - Engine::SearchEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.SearchEngineConfig").msgclass - Engine::MediaRecommendationEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig").msgclass - Engine::MediaRecommendationEngineConfig::OptimizationObjectiveConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.OptimizationObjectiveConfig").msgclass - Engine::MediaRecommendationEngineConfig::EngineFeaturesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.EngineFeaturesConfig").msgclass - Engine::MediaRecommendationEngineConfig::RecommendedForYouFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.RecommendedForYouFeatureConfig").msgclass - Engine::MediaRecommendationEngineConfig::MostPopularFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.MostPopularFeatureConfig").msgclass - Engine::MediaRecommendationEngineConfig::TrainingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.MediaRecommendationEngineConfig.TrainingState").enummodule - Engine::ChatEngineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineConfig").msgclass - Engine::ChatEngineConfig::AgentCreationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineConfig.AgentCreationConfig").msgclass - Engine::CommonConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.CommonConfig").msgclass - Engine::ChatEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Engine.ChatEngineMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb deleted file mode 100644 index 02ec976cd98a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/engine_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/engine_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/discoveryengine/v1/engine_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xae\x01\n\x13\x43reateEngineRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12<\n\x06\x65ngine\x18\x02 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.EngineB\x03\xe0\x41\x02\x12\x16\n\tengine_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"x\n\x14\x43reateEngineMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"R\n\x13\x44\x65leteEngineRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\"x\n\x14\x44\x65leteEngineMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"O\n\x10GetEngineRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\"\x9d\x01\n\x12ListEnginesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/Collection\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"h\n\x13ListEnginesResponse\x12\x38\n\x07\x65ngines\x18\x01 \x03(\x0b\x32\'.google.cloud.discoveryengine.v1.Engine\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x13UpdateEngineRequest\x12<\n\x06\x65ngine\x18\x01 \x01(\x0b\x32\'.google.cloud.discoveryengine.v1.EngineB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xe3\t\n\rEngineService\x12\xaa\x02\n\x0c\x43reateEngine\x12\x34.google.cloud.discoveryengine.v1.CreateEngineRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41^\n&google.cloud.discoveryengine.v1.Engine\x12\x34google.cloud.discoveryengine.v1.CreateEngineMetadata\xda\x41\x17parent,engine,engine_id\x82\xd3\xe4\x93\x02\x43\"9/v1/{parent=projects/*/locations/*/collections/*}/engines:\x06\x65ngine\x12\xfe\x01\n\x0c\x44\x65leteEngine\x12\x34.google.cloud.discoveryengine.v1.DeleteEngineRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41M\n\x15google.protobuf.Empty\x12\x34google.cloud.discoveryengine.v1.DeleteEngineMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/collections/*/engines/*}\x12\xd4\x01\n\x0cUpdateEngine\x12\x34.google.cloud.discoveryengine.v1.UpdateEngineRequest\x1a\'.google.cloud.discoveryengine.v1.Engine\"e\xda\x41\x12\x65ngine,update_mask\x82\xd3\xe4\x93\x02J2@/v1/{engine.name=projects/*/locations/*/collections/*/engines/*}:\x06\x65ngine\x12\xb1\x01\n\tGetEngine\x12\x31.google.cloud.discoveryengine.v1.GetEngineRequest\x1a\'.google.cloud.discoveryengine.v1.Engine\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/collections/*/engines/*}\x12\xc4\x01\n\x0bListEngines\x12\x33.google.cloud.discoveryengine.v1.ListEnginesRequest\x1a\x34.google.cloud.discoveryengine.v1.ListEnginesResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/collections/*}/engines\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12\x45ngineServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.Engine", "google/cloud/discoveryengine/v1/engine.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - CreateEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateEngineRequest").msgclass - CreateEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateEngineMetadata").msgclass - DeleteEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteEngineRequest").msgclass - DeleteEngineMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteEngineMetadata").msgclass - GetEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetEngineRequest").msgclass - ListEnginesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListEnginesRequest").msgclass - ListEnginesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListEnginesResponse").msgclass - UpdateEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateEngineRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb deleted file mode 100644 index 3752d22f8197..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/engine_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/engine_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module EngineService - # Service for managing [Engine][google.cloud.discoveryengine.v1.Engine] - # configuration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.EngineService' - - # Creates a [Engine][google.cloud.discoveryengine.v1.Engine]. - rpc :CreateEngine, ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::Google::Longrunning::Operation - # Deletes a [Engine][google.cloud.discoveryengine.v1.Engine]. - rpc :DeleteEngine, ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::Google::Longrunning::Operation - # Updates an [Engine][google.cloud.discoveryengine.v1.Engine] - rpc :UpdateEngine, ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::Engine - # Gets a [Engine][google.cloud.discoveryengine.v1.Engine]. - rpc :GetEngine, ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::Engine - # Lists all the [Engine][google.cloud.discoveryengine.v1.Engine]s associated - # with the project. - rpc :ListEngines, ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb deleted file mode 100644 index f506c7527d54..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/grounded_generation_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/grounding_pb' - - -descriptor_data = "\nAgoogle/cloud/discoveryengine/v1/grounded_generation_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/discoveryengine/v1/grounding.proto\"\x99\x01\n\x19GroundedGenerationContent\x12\x0c\n\x04role\x18\x01 \x01(\t\x12N\n\x05parts\x18\x02 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.GroundedGenerationContent.Part\x1a\x1e\n\x04Part\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x42\x06\n\x04\x64\x61ta\"\x9f\x15\n\x1eGenerateGroundedContentRequest\x12\x41\n\x08location\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Location\x12V\n\x12system_instruction\x18\x05 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12L\n\x08\x63ontents\x18\x02 \x03(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12g\n\x0fgeneration_spec\x18\x03 \x01(\x0b\x32N.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec\x12\x65\n\x0egrounding_spec\x18\x04 \x01(\x0b\x32M.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec\x12\x64\n\x0buser_labels\x18\x06 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.UserLabelsEntry\x1a\xdb\x02\n\x0eGenerationSpec\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x18\n\x0btemperature\x18\x04 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05top_p\x18\x05 \x01(\x02H\x01\x88\x01\x01\x12\x12\n\x05top_k\x18\x07 \x01(\x05H\x02\x88\x01\x01\x12\x1e\n\x11\x66requency_penalty\x18\x08 \x01(\x02H\x03\x88\x01\x01\x12\x11\n\x04seed\x18\x0c \x01(\x05H\x04\x88\x01\x01\x12\x1d\n\x10presence_penalty\x18\t \x01(\x02H\x05\x88\x01\x01\x12\x1e\n\x11max_output_tokens\x18\n \x01(\x05H\x06\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x08\n\x06_top_kB\x14\n\x12_frequency_penaltyB\x07\n\x05_seedB\x13\n\x11_presence_penaltyB\x14\n\x12_max_output_tokens\x1a\xbb\x03\n\x1d\x44ynamicRetrievalConfiguration\x12\x8a\x01\n\tpredictor\x18\x01 \x01(\x0b\x32w.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor\x1a\x8c\x02\n\x19\x44ynamicRetrievalPredictor\x12\x90\x01\n\x07version\x18\x01 \x01(\x0e\x32\x7f.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version\x12\x16\n\tthreshold\x18\x02 \x01(\x02H\x00\x88\x01\x01\"6\n\x07Version\x12\x17\n\x13VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0eV1_INDEPENDENT\x10\x01\x42\x0c\n\n_threshold\x1a\x91\t\n\x0fGroundingSource\x12u\n\rinline_source\x18\x01 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSourceH\x00\x12u\n\rsearch_source\x18\x02 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSourceH\x00\x12\x82\x01\n\x14google_search_source\x18\x03 \x01(\x0b\x32\x62.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSourceH\x00\x12\x97\x01\n\x1f\x65nterprise_web_retrieval_source\x18\x08 \x01(\x0b\x32l.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.EnterpriseWebRetrievalSourceH\x00\x1a\x8d\x02\n\x0cInlineSource\x12G\n\x0fgrounding_facts\x18\x01 \x03(\x0b\x32..google.cloud.discoveryengine.v1.GroundingFact\x12\x80\x01\n\nattributes\x18\x02 \x03(\x0b\x32l.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x98\x01\n\x0cSearchSource\x12I\n\x0eserving_config\x18\x01 \x01(\tB1\xfa\x41.\n,discoveryengine.googleapis.com/ServingConfig\x12\x18\n\x10max_result_count\x18\x02 \x01(\x05\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x13\n\x0bsafe_search\x18\x05 \x01(\x08\x1a\x9b\x01\n\x12GoogleSearchSource\x12\x84\x01\n\x18\x64ynamic_retrieval_config\x18\x02 \x01(\x0b\x32].google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfigurationB\x03\xe0\x41\x01\x1a\x1e\n\x1c\x45nterpriseWebRetrievalSourceB\x08\n\x06source\x1a{\n\rGroundingSpec\x12j\n\x11grounding_sources\x18\x01 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe9\x14\n\x1fGenerateGroundedContentResponse\x12^\n\ncandidates\x18\x01 \x03(\x0b\x32J.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate\x1a\xe5\x13\n\tCandidate\x12\r\n\x05index\x18\x01 \x01(\x05\x12K\n\x07\x63ontent\x18\x02 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.GroundedGenerationContent\x12\x1c\n\x0fgrounding_score\x18\x03 \x01(\x02H\x00\x88\x01\x01\x12x\n\x12grounding_metadata\x18\x04 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata\x1a\xcf\x11\n\x11GroundingMetadata\x12\x8a\x01\n\x12retrieval_metadata\x18\x05 \x03(\x0b\x32n.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata\x12\x42\n\x0esupport_chunks\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.FactChunk\x12\x1a\n\x12web_search_queries\x18\x03 \x03(\t\x12\x89\x01\n\x12search_entry_point\x18\x04 \x01(\x0b\x32m.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint\x12\x88\x01\n\x11grounding_support\x18\x02 \x03(\x0b\x32m.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport\x12z\n\x06images\x18\t \x03(\x0b\x32j.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata\x1a\xa7\x03\n\x11RetrievalMetadata\x12\x85\x01\n\x06source\x18\x01 \x01(\x0e\x32u.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source\x12\x99\x01\n\x1a\x64ynamic_retrieval_metadata\x18\x02 \x01(\x0b\x32u.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata\"n\n\x06Source\x12\x16\n\x12SOURCE_UNSPECIFIED\x10\x00\x12\x14\n\x10VERTEX_AI_SEARCH\x10\x01\x12\x11\n\rGOOGLE_SEARCH\x10\x03\x12\x12\n\x0eINLINE_CONTENT\x10\x02\x12\x0f\n\x0bGOOGLE_MAPS\x10\x04\x1a\xb7\x01\n\x18\x44ynamicRetrievalMetadata\x12\x9a\x01\n\x12predictor_metadata\x18\x01 \x01(\x0b\x32~.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata\x1a\x9e\x02\n!DynamicRetrievalPredictorMetadata\x12\x98\x01\n\x07version\x18\x01 \x01(\x0e\x32\x86\x01.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version\x12\x17\n\nprediction\x18\x02 \x01(\x02H\x00\x88\x01\x01\"6\n\x07Version\x12\x17\n\x13VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0eV1_INDEPENDENT\x10\x01\x42\r\n\x0b_prediction\x1a>\n\x10SearchEntryPoint\x12\x18\n\x10rendered_content\x18\x01 \x01(\t\x12\x10\n\x08sdk_blob\x18\x02 \x01(\x0c\x1as\n\x10GroundingSupport\x12\x12\n\nclaim_text\x18\x01 \x01(\t\x12\x1d\n\x15support_chunk_indices\x18\x03 \x03(\x05\x12\x1a\n\rsupport_score\x18\x02 \x01(\x02H\x00\x88\x01\x01\x42\x10\n\x0e_support_score\x1a\xff\x03\n\rImageMetadata\x12\x7f\n\x05image\x18\x01 \x01(\x0b\x32p.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image\x12\x83\x01\n\tthumbnail\x18\x02 \x01(\x0b\x32p.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image\x12\x86\x01\n\x06source\x18\x03 \x01(\x0b\x32v.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.WebsiteInfo\x1a)\n\x0bWebsiteInfo\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x1a\x33\n\x05Image\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x42\x12\n\x10_grounding_score\"\x90\x01\n\x12\x43heckGroundingSpec\x12\x1f\n\x12\x63itation_threshold\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12%\n\x18\x65nable_claim_level_score\x18\x04 \x01(\x08H\x01\x88\x01\x01\x42\x15\n\x13_citation_thresholdB\x1b\n\x19_enable_claim_level_score\"\x9f\x03\n\x15\x43heckGroundingRequest\x12P\n\x10grounding_config\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.discoveryengine.googleapis.com/GroundingConfig\x12\x18\n\x10\x61nswer_candidate\x18\x02 \x01(\t\x12=\n\x05\x66\x61\x63ts\x18\x03 \x03(\x0b\x32..google.cloud.discoveryengine.v1.GroundingFact\x12K\n\x0egrounding_spec\x18\x04 \x01(\x0b\x32\x33.google.cloud.discoveryengine.v1.CheckGroundingSpec\x12[\n\x0buser_labels\x18\x05 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.CheckGroundingRequest.UserLabelsEntry\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xce\x04\n\x16\x43heckGroundingResponse\x12\x1a\n\rsupport_score\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12@\n\x0c\x63ited_chunks\x18\x03 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.FactChunk\x12\x64\n\x0b\x63ited_facts\x18\x06 \x03(\x0b\x32O.google.cloud.discoveryengine.v1.CheckGroundingResponse.CheckGroundingFactChunk\x12M\n\x06\x63laims\x18\x04 \x03(\x0b\x32=.google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim\x1a-\n\x17\x43heckGroundingFactChunk\x12\x12\n\nchunk_text\x18\x01 \x01(\t\x1a\xdf\x01\n\x05\x43laim\x12\x16\n\tstart_pos\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x14\n\x07\x65nd_pos\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x12\n\nclaim_text\x18\x03 \x01(\t\x12\x18\n\x10\x63itation_indices\x18\x04 \x03(\x05\x12%\n\x18grounding_check_required\x18\x06 \x01(\x08H\x02\x88\x01\x01\x12\x12\n\x05score\x18\x07 \x01(\x01H\x03\x88\x01\x01\x42\x0c\n\n_start_posB\n\n\x08_end_posB\x1b\n\x19_grounding_check_requiredB\x08\n\x06_scoreB\x10\n\x0e_support_score2\xa8\x06\n\x19GroundedGenerationService\x12\xf6\x01\n\x1dStreamGenerateGroundedContent\x12?.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest\x1a@.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse\"N\x82\xd3\xe4\x93\x02H\"C/v1/{location=projects/*/locations/*}:streamGenerateGroundedContent:\x01*(\x01\x30\x01\x12\xe6\x01\n\x17GenerateGroundedContent\x12?.google.cloud.discoveryengine.v1.GenerateGroundedContentRequest\x1a@.google.cloud.discoveryengine.v1.GenerateGroundedContentResponse\"H\x82\xd3\xe4\x93\x02\x42\"=/v1/{location=projects/*/locations/*}:generateGroundedContent:\x01*\x12\xd4\x01\n\x0e\x43heckGrounding\x12\x36.google.cloud.discoveryengine.v1.CheckGroundingRequest\x1a\x37.google.cloud.discoveryengine.v1.CheckGroundingResponse\"Q\x82\xd3\xe4\x93\x02K\"F/v1/{grounding_config=projects/*/locations/*/groundingConfigs/*}:check:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x91\x02\n#com.google.cloud.discoveryengine.v1B\x1eGroundedGenerationServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.GroundingFact", "google/cloud/discoveryengine/v1/grounding.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - GroundedGenerationContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundedGenerationContent").msgclass - GroundedGenerationContent::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundedGenerationContent.Part").msgclass - GenerateGroundedContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest").msgclass - GenerateGroundedContentRequest::GenerationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec").msgclass - GenerateGroundedContentRequest::DynamicRetrievalConfiguration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration").msgclass - GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor").msgclass - GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor::Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.DynamicRetrievalConfiguration.DynamicRetrievalPredictor.Version").enummodule - GenerateGroundedContentRequest::GroundingSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource").msgclass - GenerateGroundedContentRequest::GroundingSource::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.InlineSource").msgclass - GenerateGroundedContentRequest::GroundingSource::SearchSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.SearchSource").msgclass - GenerateGroundedContentRequest::GroundingSource::GoogleSearchSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.GoogleSearchSource").msgclass - GenerateGroundedContentRequest::GroundingSource::EnterpriseWebRetrievalSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSource.EnterpriseWebRetrievalSource").msgclass - GenerateGroundedContentRequest::GroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GroundingSpec").msgclass - GenerateGroundedContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse").msgclass - GenerateGroundedContentResponse::Candidate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata::Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.RetrievalMetadata.Source").enummodule - GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalMetadata").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata::Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.DynamicRetrievalPredictorMetadata.Version").enummodule - GenerateGroundedContentResponse::Candidate::GroundingMetadata::SearchEntryPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.SearchEntryPoint").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::GroundingSupport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.GroundingSupport").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::WebsiteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.WebsiteInfo").msgclass - GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GenerateGroundedContentResponse.Candidate.GroundingMetadata.ImageMetadata.Image").msgclass - CheckGroundingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingSpec").msgclass - CheckGroundingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingRequest").msgclass - CheckGroundingResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse").msgclass - CheckGroundingResponse::CheckGroundingFactChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse.CheckGroundingFactChunk").msgclass - CheckGroundingResponse::Claim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb deleted file mode 100644 index f579120188fb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/grounded_generation_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/grounded_generation_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module GroundedGenerationService - # Service for grounded generation. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.GroundedGenerationService' - - # Generates grounded content in a streaming fashion. - rpc :StreamGenerateGroundedContent, stream(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest), stream(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse) - # Generates grounded content. - rpc :GenerateGroundedContent, ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse - # Performs a grounding check. - rpc :CheckGrounding, ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb deleted file mode 100644 index 300c5940833b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/grounding.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n/google/cloud/discoveryengine/v1/grounding.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xa9\x01\n\rGroundingFact\x12\x11\n\tfact_text\x18\x01 \x01(\t\x12R\n\nattributes\x18\x02 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.GroundingFact.AttributesEntry\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfa\x01\n\tFactChunk\x12\x12\n\nchunk_text\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\r\n\x05index\x18\x04 \x01(\x05\x12W\n\x0fsource_metadata\x18\x03 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.FactChunk.SourceMetadataEntry\x12\x0b\n\x03uri\x18\x05 \x01(\t\x12\r\n\x05title\x18\x06 \x01(\t\x12\x0e\n\x06\x64omain\x18\x07 \x01(\t\x1a\x35\n\x13SourceMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0eGroundingProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - GroundingFact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GroundingFact").msgclass - FactChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FactChunk").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb deleted file mode 100644 index 55f73b95b1a6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/identity_mapping_store.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/cmek_config_service_pb' - - -descriptor_data = "\n.google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest\x1a\x1d.google.longrunning.Operation\"\xf8\x01\xca\x41\x87\x01\n>google.cloud.discoveryengine.v1.ImportIdentityMappingsResponse\x12\x45google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata\x82\xd3\xe4\x93\x02g\"b/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:importIdentityMappings:\x01*\x12\xc5\x02\n\x15PurgeIdentityMappings\x12=.google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest\x1a\x1d.google.longrunning.Operation\"\xcd\x01\xca\x41^\n\x15google.protobuf.Empty\x12\x45google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata\x82\xd3\xe4\x93\x02\x66\"a/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:purgeIdentityMappings:\x01*\x12\xfd\x01\n\x14ListIdentityMappings\x12<.google.cloud.discoveryengine.v1.ListIdentityMappingsRequest\x1a=.google.cloud.discoveryengine.v1.ListIdentityMappingsResponse\"h\x82\xd3\xe4\x93\x02\x62\x12`/v1/{identity_mapping_store=projects/*/locations/*/identityMappingStores/*}:listIdentityMappings\x12\xee\x01\n\x19ListIdentityMappingStores\x12\x41.google.cloud.discoveryengine.v1.ListIdentityMappingStoresRequest\x1a\x42.google.cloud.discoveryengine.v1.ListIdentityMappingStoresResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/identityMappingStores\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x93\x02\n#com.google.cloud.discoveryengine.v1B IdentityMappingStoreServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.IdentityMappingStore", "google/cloud/discoveryengine/v1/identity_mapping_store.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - CreateIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateIdentityMappingStoreRequest").msgclass - GetIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetIdentityMappingStoreRequest").msgclass - DeleteIdentityMappingStoreRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteIdentityMappingStoreRequest").msgclass - ImportIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest").msgclass - ImportIdentityMappingsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsRequest.InlineSource").msgclass - ImportIdentityMappingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportIdentityMappingsResponse").msgclass - PurgeIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest").msgclass - PurgeIdentityMappingsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeIdentityMappingsRequest.InlineSource").msgclass - ListIdentityMappingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingsRequest").msgclass - ListIdentityMappingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingsResponse").msgclass - ListIdentityMappingStoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingStoresRequest").msgclass - ListIdentityMappingStoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListIdentityMappingStoresResponse").msgclass - IdentityMappingEntryOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.IdentityMappingEntryOperationMetadata").msgclass - DeleteIdentityMappingStoreMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteIdentityMappingStoreMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb deleted file mode 100644 index 1794bb14c265..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/identity_mapping_store_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/identity_mapping_store_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module IdentityMappingStoreService - # Service for managing Identity Mapping Stores. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.IdentityMappingStoreService' - - # Creates a new Identity Mapping Store. - rpc :CreateIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore - # Gets the Identity Mapping Store. - rpc :GetIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore - # Deletes the Identity Mapping Store. - rpc :DeleteIdentityMappingStore, ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, ::Google::Longrunning::Operation - # Imports a list of Identity Mapping Entries to an Identity Mapping Store. - rpc :ImportIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, ::Google::Longrunning::Operation - # Purges specified or all Identity Mapping Entries from an Identity Mapping - # Store. - rpc :PurgeIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, ::Google::Longrunning::Operation - # Lists Identity Mappings in an Identity Mapping Store. - rpc :ListIdentityMappings, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse - # Lists all Identity Mapping Stores. - rpc :ListIdentityMappingStores, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb deleted file mode 100644 index 165a3dd47545..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/import_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/completion_pb' -require 'google/cloud/discoveryengine/v1/document_pb' -require 'google/cloud/discoveryengine/v1/user_event_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/date_pb' - - -descriptor_data = "\n3google/cloud/discoveryengine/v1/import_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/discoveryengine/v1/completion.proto\x1a.google/cloud/discoveryengine/v1/document.proto\x1a\x30google/cloud/discoveryengine/v1/user_event.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\"9\n\tGcsSource\x12\x17\n\ninput_uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x61ta_schema\x18\x02 \x01(\t\"\xbc\x01\n\x0e\x42igQuerySource\x12+\n\x0epartition_date\x18\x05 \x01(\x0b\x32\x11.google.type.DateH\x00\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x17\n\ndataset_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x61ta_schema\x18\x06 \x01(\tB\x0b\n\tpartition\"\x89\x01\n\rSpannerSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x11\x65nable_data_boost\x18\x05 \x01(\x08\"\x8d\x07\n\x0f\x42igtableOptions\x12\x16\n\x0ekey_field_name\x18\x01 \x01(\t\x12P\n\x08\x66\x61milies\x18\x02 \x03(\x0b\x32>.google.cloud.discoveryengine.v1.BigtableOptions.FamiliesEntry\x1a\x8e\x02\n\x14\x42igtableColumnFamily\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12K\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32\x39.google.cloud.discoveryengine.v1.BigtableOptions.Encoding\x12\x43\n\x04type\x18\x03 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.BigtableOptions.Type\x12P\n\x07\x63olumns\x18\x04 \x03(\x0b\x32?.google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumn\x1a\xce\x01\n\x0e\x42igtableColumn\x12\x16\n\tqualifier\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x12\n\nfield_name\x18\x02 \x01(\t\x12K\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x39.google.cloud.discoveryengine.v1.BigtableOptions.Encoding\x12\x43\n\x04type\x18\x04 \x01(\x0e\x32\x35.google.cloud.discoveryengine.v1.BigtableOptions.Type\x1av\n\rFamiliesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12T\n\x05value\x18\x02 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumnFamily:\x02\x38\x01\"z\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\n\n\x06NUMBER\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x0f\n\x0bVAR_INTEGER\x10\x04\x12\x0f\n\x0b\x42IG_NUMERIC\x10\x05\x12\x0b\n\x07\x42OOLEAN\x10\x06\x12\x08\n\x04JSON\x10\x07\":\n\x08\x45ncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\n\n\x06\x42INARY\x10\x02\"\xa6\x01\n\x0e\x42igtableSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12O\n\x10\x62igtable_options\x18\x04 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.BigtableOptionsB\x03\xe0\x41\x02\"\xb6\x01\n\x0f\x46hirStoreSource\x12?\n\nfhir_store\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#healthcare.googleapis.com/FhirStore\x12\x17\n\x0fgcs_staging_dir\x18\x02 \x01(\t\x12\x16\n\x0eresource_types\x18\x03 \x03(\t\x12\x31\n$update_from_latest_predefined_schema\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x99\x01\n\x0e\x43loudSqlSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x05 \x01(\t\x12\x0f\n\x07offload\x18\x06 \x01(\x08\"\xa0\x01\n\rAlloyDbSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0blocation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ncluster_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x61tabase_id\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08table_id\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x06 \x01(\t\"t\n\x0f\x46irestoreSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rcollection_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\x0fgcs_staging_dir\x18\x04 \x01(\t\"8\n\x11ImportErrorConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xf3\x03\n\x17ImportUserEventsRequest\x12^\n\rinline_source\x18\x02 \x01(\x0b\x32\x45.google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x1aT\n\x0cInlineSource\x12\x44\n\x0buser_events\x18\x01 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.UserEventB\x03\xe0\x41\x02\x42\x08\n\x06source\"\xcb\x01\n\x18ImportUserEventsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x1b\n\x13joined_events_count\x18\x03 \x01(\x03\x12\x1d\n\x15unjoined_events_count\x18\x04 \x01(\x03\"\xaa\x01\n\x18ImportUserEventsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"\xbe\x01\n\x17ImportDocumentsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x13\n\x0btotal_count\x18\x05 \x01(\x03\"\xf7\t\n\x16ImportDocumentsRequest\x12]\n\rinline_source\x18\x02 \x01(\x0b\x32\x44.google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12M\n\x11\x66hir_store_source\x18\n \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.FhirStoreSourceH\x00\x12H\n\x0espanner_source\x18\x0b \x01(\x0b\x32..google.cloud.discoveryengine.v1.SpannerSourceH\x00\x12K\n\x10\x63loud_sql_source\x18\x0c \x01(\x0b\x32/.google.cloud.discoveryengine.v1.CloudSqlSourceH\x00\x12L\n\x10\x66irestore_source\x18\r \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.FirestoreSourceH\x00\x12I\n\x0f\x61lloy_db_source\x18\x0e \x01(\x0b\x32..google.cloud.discoveryengine.v1.AlloyDbSourceH\x00\x12J\n\x0f\x62igtable_source\x18\x0f \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigtableSourceH\x00\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12g\n\x13reconciliation_mode\x18\x06 \x01(\x0e\x32J.google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode\x12/\n\x0bupdate_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x19\n\x11\x61uto_generate_ids\x18\x08 \x01(\x08\x12\x10\n\x08id_field\x18\t \x01(\t\x12\"\n\x15\x66orce_refresh_content\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x1aQ\n\x0cInlineSource\x12\x41\n\tdocuments\x18\x01 \x03(\x0b\x32).google.cloud.discoveryengine.v1.DocumentB\x03\xe0\x41\x02\"T\n\x12ReconciliationMode\x12#\n\x1fRECONCILIATION_MODE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINCREMENTAL\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x42\x08\n\x06source\"\x8e\x01\n\x17ImportDocumentsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\"\x85\x03\n&ImportSuggestionDenyListEntriesRequest\x12m\n\rinline_source\x18\x02 \x01(\x0b\x32T.google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x1a^\n\x0cInlineSource\x12N\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.SuggestionDenyListEntryB\x03\xe0\x41\x02\x42\x08\n\x06source\"\x92\x01\n\'ImportSuggestionDenyListEntriesResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12\x1e\n\x16imported_entries_count\x18\x02 \x01(\x03\x12\x1c\n\x14\x66\x61iled_entries_count\x18\x03 \x01(\x03\"\x8b\x01\n\'ImportSuggestionDenyListEntriesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x94\x04\n\"ImportCompletionSuggestionsRequest\x12i\n\rinline_source\x18\x02 \x01(\x0b\x32P.google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest.InlineSourceH\x00\x12@\n\ngcs_source\x18\x03 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12J\n\x0f\x62igquery_source\x18\x04 \x01(\x0b\x32/.google.cloud.discoveryengine.v1.BigQuerySourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\x0c\x65rror_config\x18\x05 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x1a_\n\x0cInlineSource\x12O\n\x0bsuggestions\x18\x01 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.CompletionSuggestionB\x03\xe0\x41\x02\x42\x08\n\x06source\"\x9a\x01\n#ImportCompletionSuggestionsResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\"\xb5\x01\n#ImportCompletionSuggestionsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x42\x84\x02\n#com.google.cloud.discoveryengine.v1B\x11ImportConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.type.Date", "google/type/date.proto"], - ["google.cloud.discoveryengine.v1.UserEvent", "google/cloud/discoveryengine/v1/user_event.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], - ["google.cloud.discoveryengine.v1.SuggestionDenyListEntry", "google/cloud/discoveryengine/v1/completion.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GcsSource").msgclass - BigQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigQuerySource").msgclass - SpannerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SpannerSource").msgclass - BigtableOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions").msgclass - BigtableOptions::BigtableColumnFamily = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumnFamily").msgclass - BigtableOptions::BigtableColumn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.BigtableColumn").msgclass - BigtableOptions::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.Type").enummodule - BigtableOptions::Encoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableOptions.Encoding").enummodule - BigtableSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BigtableSource").msgclass - FhirStoreSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FhirStoreSource").msgclass - CloudSqlSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CloudSqlSource").msgclass - AlloyDbSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.AlloyDbSource").msgclass - FirestoreSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FirestoreSource").msgclass - ImportErrorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportErrorConfig").msgclass - ImportUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsRequest").msgclass - ImportUserEventsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsRequest.InlineSource").msgclass - ImportUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsResponse").msgclass - ImportUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportUserEventsMetadata").msgclass - ImportDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsMetadata").msgclass - ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest").msgclass - ImportDocumentsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest.InlineSource").msgclass - ImportDocumentsRequest::ReconciliationMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode").enummodule - ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportDocumentsResponse").msgclass - ImportSuggestionDenyListEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest").msgclass - ImportSuggestionDenyListEntriesRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesRequest.InlineSource").msgclass - ImportSuggestionDenyListEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesResponse").msgclass - ImportSuggestionDenyListEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesMetadata").msgclass - ImportCompletionSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest").msgclass - ImportCompletionSuggestionsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsRequest.InlineSource").msgclass - ImportCompletionSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsResponse").msgclass - ImportCompletionSuggestionsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ImportCompletionSuggestionsMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb deleted file mode 100644 index ca756d1603db..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/project.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/discoveryengine/v1/project.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdd\x05\n\x07Project\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x19provision_completion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12]\n\x11service_terms_map\x18\x04 \x03(\x0b\x32=.google.cloud.discoveryengine.v1.Project.ServiceTermsMapEntryB\x03\xe0\x41\x03\x1a\xb5\x02\n\x0cServiceTerms\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12J\n\x05state\x18\x04 \x01(\x0e\x32;.google.cloud.discoveryengine.v1.Project.ServiceTerms.State\x12/\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0c\x64\x65\x63line_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTERMS_ACCEPTED\x10\x01\x12\x11\n\rTERMS_PENDING\x10\x02\x12\x12\n\x0eTERMS_DECLINED\x10\x03\x1am\n\x14ServiceTermsMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x44\n\x05value\x18\x02 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.Project.ServiceTerms:\x02\x38\x01:?\xea\x41<\n&discoveryengine.googleapis.com/Project\x12\x12projects/{project}B\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0cProjectProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Project = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project").msgclass - Project::ServiceTerms = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project.ServiceTerms").msgclass - Project::ServiceTerms::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Project.ServiceTerms.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb deleted file mode 100644 index 640ebf06f334..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/project_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/project_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n5google/cloud/discoveryengine/v1/project_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/discoveryengine/v1/project.proto\x1a#google/longrunning/operations.proto\"\xa0\x01\n\x17ProvisionProjectRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Project\x12\"\n\x15\x61\x63\x63\x65pt_data_use_terms\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02\x12#\n\x16\x64\x61ta_use_terms_version\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x1a\n\x18ProvisionProjectMetadata2\xec\x02\n\x0eProjectService\x12\x85\x02\n\x10ProvisionProject\x12\x38.google.cloud.discoveryengine.v1.ProvisionProjectRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41\x63\n\'google.cloud.discoveryengine.v1.Project\x12\x38google.cloud.discoveryengine.v1.ProvisionProjectMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02$\"\x1f/v1/{name=projects/*}:provision:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13ProjectServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - ProvisionProjectRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ProvisionProjectRequest").msgclass - ProvisionProjectMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ProvisionProjectMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb deleted file mode 100644 index c35c2be5e36c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/project_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/project_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module ProjectService - # Service for operations on the - # [Project][google.cloud.discoveryengine.v1.Project]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.ProjectService' - - # Provisions the project resource. During the - # process, related systems will get prepared and initialized. - # - # Caller must read the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms), and optionally - # specify in request to provide consent to that service terms. - rpc :ProvisionProject, ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb deleted file mode 100644 index b03c285bb6a4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/purge_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/import_config_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n2google/cloud/discoveryengine/v1/purge_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"~\n\x16PurgeUserEventsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\".\n\x17PurgeUserEventsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\"\xa9\x01\n\x17PurgeUserEventsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"7\n\x10PurgeErrorConfig\x12\x14\n\ngcs_prefix\x18\x01 \x01(\tH\x00\x42\r\n\x0b\x64\x65stination\"\xc1\x03\n\x15PurgeDocumentsRequest\x12@\n\ngcs_source\x18\x05 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.GcsSourceH\x00\x12\\\n\rinline_source\x18\x06 \x01(\x0b\x32\x43.google.cloud.discoveryengine.v1.PurgeDocumentsRequest.InlineSourceH\x00\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%discoveryengine.googleapis.com/Branch\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0c\x65rror_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.discoveryengine.v1.PurgeErrorConfig\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\x1aR\n\x0cInlineSource\x12\x42\n\tdocuments\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentB\x08\n\x06source\"q\n\x16PurgeDocumentsResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12\x42\n\x0cpurge_sample\x18\x02 \x03(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/Document\"\xbf\x01\n\x16PurgeDocumentsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\x12\x15\n\rignored_count\x18\x05 \x01(\x03\"i\n%PurgeSuggestionDenyListEntriesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"h\n&PurgeSuggestionDenyListEntriesResponse\x12\x13\n\x0bpurge_count\x18\x01 \x01(\x03\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x8a\x01\n&PurgeSuggestionDenyListEntriesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n!PurgeCompletionSuggestionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"h\n\"PurgeCompletionSuggestionsResponse\x12\x17\n\x0fpurge_succeeded\x18\x01 \x01(\x08\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x86\x01\n\"PurgeCompletionSuggestionsMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10PurgeConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.GcsSource", "google/cloud/discoveryengine/v1/import_config.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - PurgeUserEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsRequest").msgclass - PurgeUserEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsResponse").msgclass - PurgeUserEventsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeUserEventsMetadata").msgclass - PurgeErrorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeErrorConfig").msgclass - PurgeDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsRequest").msgclass - PurgeDocumentsRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsRequest.InlineSource").msgclass - PurgeDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsResponse").msgclass - PurgeDocumentsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeDocumentsMetadata").msgclass - PurgeSuggestionDenyListEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesRequest").msgclass - PurgeSuggestionDenyListEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse").msgclass - PurgeSuggestionDenyListEntriesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata").msgclass - PurgeCompletionSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsRequest").msgclass - PurgeCompletionSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsResponse").msgclass - PurgeCompletionSuggestionsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PurgeCompletionSuggestionsMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb deleted file mode 100644 index a66ecbb6b4f0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/rank_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n2google/cloud/discoveryengine/v1/rank_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"J\n\rRankingRecord\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\"\xff\x02\n\x0bRankRequest\x12L\n\x0eranking_config\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,discoveryengine.googleapis.com/RankingConfig\x12\r\n\x05model\x18\x02 \x01(\t\x12\r\n\x05top_n\x18\x03 \x01(\x05\x12\r\n\x05query\x18\x04 \x01(\t\x12\x44\n\x07records\x18\x05 \x03(\x0b\x32..google.cloud.discoveryengine.v1.RankingRecordB\x03\xe0\x41\x02\x12)\n!ignore_record_details_in_response\x18\x06 \x01(\x08\x12Q\n\x0buser_labels\x18\x07 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.RankRequest.UserLabelsEntry\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"O\n\x0cRankResponse\x12?\n\x07records\x18\x05 \x03(\x0b\x32..google.cloud.discoveryengine.v1.RankingRecord2\x95\x02\n\x0bRankService\x12\xb1\x01\n\x04Rank\x12,.google.cloud.discoveryengine.v1.RankRequest\x1a-.google.cloud.discoveryengine.v1.RankResponse\"L\x82\xd3\xe4\x93\x02\x46\"A/v1/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10RankServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - RankingRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankingRecord").msgclass - RankRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankRequest").msgclass - RankResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RankResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb deleted file mode 100644 index f4ae82f4ad0c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/rank_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/rank_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module RankService - # Service for ranking text records. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.RankService' - - # Ranks a list of text records based on the given input query. - rpc :Rank, ::Google::Cloud::DiscoveryEngine::V1::RankRequest, ::Google::Cloud::DiscoveryEngine::V1::RankResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb deleted file mode 100644 index c32f53968033..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/recommendation_service_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/recommendation_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/document_pb' -require 'google/cloud/discoveryengine/v1/user_event_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n.google.cloud.discoveryengine.v1.SearchRequest.UserLabelsEntry\x12\x8c\x01\n)natural_language_query_understanding_spec\x18\x1c \x01(\x0b\x32T.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpecB\x03\xe0\x41\x01\x12\x63\n\x17search_as_you_type_spec\x18\x1f \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec\x12U\n\x0c\x64isplay_spec\x18& \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpecB\x03\xe0\x41\x01\x12X\n\x0e\x63rowding_specs\x18( \x03(\x0b\x32;.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpecB\x03\xe0\x41\x01\x12<\n\x07session\x18) \x01(\tB+\xfa\x41(\n&discoveryengine.googleapis.com/Session\x12P\n\x0csession_spec\x18* \x01(\x0b\x32:.google.cloud.discoveryengine.v1.SearchRequest.SessionSpec\x12^\n\x13relevance_threshold\x18, \x01(\x0e\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold\x12\x64\n\x14relevance_score_spec\x18\x34 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpecB\x03\xe0\x41\x01\x1a,\n\nImageQuery\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\tH\x00\x42\x07\n\x05image\x1a\xe3\x01\n\rDataStoreSpec\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nboost_spec\x18\x06 \x01(\x0b\x32\x38.google.cloud.discoveryengine.v1.SearchRequest.BoostSpecB\x03\xe0\x41\x01\x12$\n\x17\x63ustom_search_operators\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xfc\x02\n\tFacetSpec\x12Y\n\tfacet_key\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKeyB\x03\xe0\x41\x02\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xcluded_filter_keys\x18\x03 \x03(\t\x12\x1f\n\x17\x65nable_dynamic_position\x18\x04 \x01(\x08\x1a\xc5\x01\n\x08\x46\x61\x63\x65tKey\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12<\n\tintervals\x18\x02 \x03(\x0b\x32).google.cloud.discoveryengine.v1.Interval\x12\x19\n\x11restricted_values\x18\x03 \x03(\t\x12\x10\n\x08prefixes\x18\x04 \x03(\t\x12\x10\n\x08\x63ontains\x18\x05 \x03(\t\x12\x18\n\x10\x63\x61se_insensitive\x18\x06 \x01(\x08\x12\x10\n\x08order_by\x18\x07 \x01(\t\x1a\xbc\x07\n\tBoostSpec\x12j\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32K.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec\x1a\xc2\x06\n\x12\x43onditionBoostSpec\x12\x11\n\tcondition\x18\x01 \x01(\t\x12\r\n\x05\x62oost\x18\x02 \x01(\x02\x12x\n\x12\x62oost_control_spec\x18\x03 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec\x1a\x8f\x05\n\x10\x42oostControlSpec\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x82\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32j.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType\x12\x8a\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType\x12\x81\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32i.google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint\x1a=\n\x0c\x43ontrolPoint\x12\x17\n\x0f\x61ttribute_value\x18\x01 \x01(\t\x12\x14\n\x0c\x62oost_amount\x18\x02 \x01(\x02\"M\n\rAttributeType\x12\x1e\n\x1a\x41TTRIBUTE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tNUMERICAL\x10\x01\x12\r\n\tFRESHNESS\x10\x02\"C\n\x11InterpolationType\x12\"\n\x1eINTERPOLATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LINEAR\x10\x01\x1a\xd4\x01\n\x12QueryExpansionSpec\x12^\n\tcondition\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition\x12\x1e\n\x16pin_unexpanded_results\x18\x02 \x01(\x08\">\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa9\x01\n\x13SpellCorrectionSpec\x12U\n\x04mode\x18\x01 \x01(\x0e\x32G.google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode\";\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x13\n\x0fSUGGESTION_ONLY\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x1a\xa2\x0c\n\x11\x43ontentSearchSpec\x12\x62\n\x0csnippet_spec\x18\x01 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec\x12\x62\n\x0csummary_spec\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec\x12w\n\x17\x65xtractive_content_spec\x18\x03 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec\x12m\n\x12search_result_mode\x18\x04 \x01(\x0e\x32Q.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode\x12^\n\nchunk_spec\x18\x05 \x01(\x0b\x32J.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec\x1a`\n\x0bSnippetSpec\x12\x1d\n\x11max_snippet_count\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x1a\n\x0ereference_only\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x16\n\x0ereturn_snippet\x18\x03 \x01(\x08\x1a\xbc\x04\n\x0bSummarySpec\x12\x1c\n\x14summary_result_count\x18\x01 \x01(\x05\x12\x19\n\x11include_citations\x18\x02 \x01(\x08\x12 \n\x18ignore_adversarial_query\x18\x03 \x01(\x08\x12(\n ignore_non_summary_seeking_query\x18\x04 \x01(\x08\x12#\n\x1bignore_low_relevant_content\x18\t \x01(\x08\x12\'\n\x1aignore_jail_breaking_query\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12w\n\x11model_prompt_spec\x18\x05 \x01(\x0b\x32\\.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec\x12\x15\n\rlanguage_code\x18\x06 \x01(\t\x12j\n\nmodel_spec\x18\x07 \x01(\x0b\x32V.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec\x12\x1b\n\x13use_semantic_chunks\x18\x08 \x01(\x08\x1a#\n\x0fModelPromptSpec\x12\x10\n\x08preamble\x18\x01 \x01(\t\x1a\x1c\n\tModelSpec\x12\x0f\n\x07version\x18\x01 \x01(\t\x1a\xc5\x01\n\x15\x45xtractiveContentSpec\x12#\n\x1bmax_extractive_answer_count\x18\x01 \x01(\x05\x12$\n\x1cmax_extractive_segment_count\x18\x02 \x01(\x05\x12\'\n\x1freturn_extractive_segment_score\x18\x03 \x01(\x08\x12\x1d\n\x15num_previous_segments\x18\x04 \x01(\x05\x12\x19\n\x11num_next_segments\x18\x05 \x01(\x05\x1a\x41\n\tChunkSpec\x12\x1b\n\x13num_previous_chunks\x18\x01 \x01(\x05\x12\x17\n\x0fnum_next_chunks\x18\x02 \x01(\x05\"Q\n\x10SearchResultMode\x12\"\n\x1eSEARCH_RESULT_MODE_UNSPECIFIED\x10\x00\x12\r\n\tDOCUMENTS\x10\x01\x12\n\n\x06\x43HUNKS\x10\x02\x1a\xe0\x04\n%NaturalLanguageQueryUnderstandingSpec\x12\x93\x01\n\x1b\x66ilter_extraction_condition\x18\x01 \x01(\x0e\x32n.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition\x12.\n&geo_search_query_detection_field_names\x18\x02 \x03(\t\x12\x94\x01\n\x19\x65xtracted_filter_behavior\x18\x03 \x01(\x0e\x32l.google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehaviorB\x03\xe0\x41\x01\x12 \n\x13\x61llowed_field_names\x18\x04 \x03(\tB\x03\xe0\x41\x01\"Q\n\x19\x46ilterExtractionCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\"e\n\x17\x45xtractedFilterBehavior\x12)\n%EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHARD_FILTER\x10\x01\x12\x0e\n\nSOFT_BOOST\x10\x02\x1a\xc3\x01\n\x13SearchAsYouTypeSpec\x12_\n\tcondition\x18\x01 \x01(\x0e\x32L.google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition\"K\n\tCondition\x12\x19\n\x15\x43ONDITION_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x12\x08\n\x04\x41UTO\x10\x03\x1a\x98\x02\n\x0b\x44isplaySpec\x12{\n\x1cmatch_highlighting_condition\x18\x01 \x01(\x0e\x32U.google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition\"\x8b\x01\n\x1aMatchHighlightingCondition\x12,\n(MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED\x10\x00\x12\x1f\n\x1bMATCH_HIGHLIGHTING_DISABLED\x10\x01\x12\x1e\n\x1aMATCH_HIGHLIGHTING_ENABLED\x10\x02\x1a\xdb\x01\n\x0c\x43rowdingSpec\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12N\n\x04mode\x18\x03 \x01(\x0e\x32@.google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode\"Y\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x44ROP_CROWDED_RESULTS\x10\x01\x12!\n\x1d\x44\x45MOTE_CROWDED_RESULTS_TO_END\x10\x02\x1aq\n\x0bSessionSpec\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12,\n\x1fsearch_result_persistence_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\"\n _search_result_persistence_count\x1a\x39\n\x12RelevanceScoreSpec\x12#\n\x16return_relevance_score\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x45\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\x1a\x31\n\x0fUserLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x92\x01\n\x18RankingExpressionBackend\x12*\n&RANKING_EXPRESSION_BACKEND_UNSPECIFIED\x10\x00\x12\x0c\n\x04\x42YOE\x10\x01\x1a\x02\x08\x01\x12\x10\n\x08\x43LEARBOX\x10\x02\x1a\x02\x08\x01\x12\x15\n\x11RANK_BY_EMBEDDING\x10\x03\x12\x13\n\x0fRANK_BY_FORMULA\x10\x04\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xe6/\n\x0eSearchResponse\x12M\n\x07results\x18\x01 \x03(\x0b\x32<.google.cloud.discoveryengine.v1.SearchResponse.SearchResult\x12\x45\n\x06\x66\x61\x63\x65ts\x18\x02 \x03(\x0b\x32\x35.google.cloud.discoveryengine.v1.SearchResponse.Facet\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x12\x19\n\x11\x61ttribution_token\x18\x04 \x01(\t\x12\x14\n\x0credirect_uri\x18\x0c \x01(\t\x12\x17\n\x0fnext_page_token\x18\x05 \x01(\t\x12\x17\n\x0f\x63orrected_query\x18\x07 \x01(\t\x12H\n\x07summary\x18\t \x01(\x0b\x32\x37.google.cloud.discoveryengine.v1.SearchResponse.Summary\x12`\n\x14query_expansion_info\x18\x0e \x01(\x0b\x32\x42.google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo\x12\x8d\x01\n)natural_language_query_understanding_info\x18\x0f \x01(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfoB\x03\xe0\x41\x03\x12Q\n\x0csession_info\x18\x13 \x01(\x0b\x32;.google.cloud.discoveryengine.v1.SearchResponse.SessionInfo\x12T\n\x16search_link_promotions\x18\x17 \x03(\x0b\x32\x34.google.cloud.discoveryengine.v1.SearchLinkPromotion\x12Z\n\x0esemantic_state\x18$ \x01(\x0e\x32=.google.cloud.discoveryengine.v1.SearchResponse.SemanticStateB\x03\xe0\x41\x03\x1a\xa9\x08\n\x0cSearchResult\x12\n\n\x02id\x18\x01 \x01(\t\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.Document\x12\x35\n\x05\x63hunk\x18\x12 \x01(\x0b\x32&.google.cloud.discoveryengine.v1.Chunk\x12h\n\x0cmodel_scores\x18\x04 \x03(\x0b\x32M.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.ModelScoresEntryB\x03\xe0\x41\x03\x12\x63\n\x0crank_signals\x18\x07 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignalsB\x03\xe0\x41\x01\x1a\xe8\x04\n\x0bRankSignals\x12*\n\x18keyword_similarity_score\x18\x01 \x01(\x02\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12!\n\x0frelevance_score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12+\n\x19semantic_similarity_score\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x1b\n\tpctr_rank\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12!\n\x0ftopicality_rank\x18\x06 \x01(\x02\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x1e\n\x0c\x64ocument_age\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x05\x88\x01\x01\x12!\n\x0f\x62oosting_factor\x18\x08 \x01(\x02\x42\x03\xe0\x41\x01H\x06\x88\x01\x01\x12\x19\n\x0c\x64\x65\x66\x61ult_rank\x18 \x01(\x02\x42\x03\xe0\x41\x01\x12r\n\x0e\x63ustom_signals\x18! \x03(\x0b\x32U.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignalB\x03\xe0\x41\x01\x1a\x35\n\x0c\x43ustomSignal\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x42\x1b\n\x19_keyword_similarity_scoreB\x12\n\x10_relevance_scoreB\x1c\n\x1a_semantic_similarity_scoreB\x0c\n\n_pctr_rankB\x12\n\x10_topicality_rankB\x0f\n\r_document_ageB\x12\n\x10_boosting_factor\x1a_\n\x10ModelScoresEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.DoubleList:\x02\x38\x01\x1a\xf9\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12P\n\x06values\x18\x02 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue\x12\x15\n\rdynamic_facet\x18\x03 \x01(\x08\x1az\n\nFacetValue\x12\x0f\n\x05value\x18\x01 \x01(\tH\x00\x12=\n\x08interval\x18\x02 \x01(\x0b\x32).google.cloud.discoveryengine.v1.IntervalH\x00\x12\r\n\x05\x63ount\x18\x03 \x01(\x03\x42\r\n\x0b\x66\x61\x63\x65t_value\x1a\xa1\x0c\n\x07Summary\x12\x14\n\x0csummary_text\x18\x01 \x01(\t\x12m\n\x17summary_skipped_reasons\x18\x02 \x03(\x0e\x32L.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason\x12\x63\n\x11safety_attributes\x18\x03 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes\x12j\n\x15summary_with_metadata\x18\x04 \x01(\x0b\x32K.google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata\x1a\x36\n\x10SafetyAttributes\x12\x12\n\ncategories\x18\x01 \x03(\t\x12\x0e\n\x06scores\x18\x02 \x03(\x02\x1ag\n\x10\x43itationMetadata\x12S\n\tcitations\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation\x1a\x8b\x01\n\x08\x43itation\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x12W\n\x07sources\x18\x03 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource\x1a)\n\x0e\x43itationSource\x12\x17\n\x0freference_index\x18\x04 \x01(\x03\x1a\x8c\x02\n\tReference\x12\r\n\x05title\x18\x01 \x01(\t\x12\x41\n\x08\x64ocument\x18\x02 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'discoveryengine.googleapis.com/Document\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x66\n\x0e\x63hunk_contents\x18\x04 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent\x1a\x38\n\x0c\x43hunkContent\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x17\n\x0fpage_identifier\x18\x02 \x01(\t\x1a\xe2\x01\n\x13SummaryWithMetadata\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x63\n\x11\x63itation_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata\x12U\n\nreferences\x18\x03 \x03(\x0b\x32\x41.google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference\"\xf1\x02\n\x14SummarySkippedReason\x12&\n\"SUMMARY_SKIPPED_REASON_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x41\x44VERSARIAL_QUERY_IGNORED\x10\x01\x12%\n!NON_SUMMARY_SEEKING_QUERY_IGNORED\x10\x02\x12\x1f\n\x1bOUT_OF_DOMAIN_QUERY_IGNORED\x10\x03\x12\x1e\n\x1aPOTENTIAL_POLICY_VIOLATION\x10\x04\x12\x19\n\x15LLM_ADDON_NOT_ENABLED\x10\x05\x12\x17\n\x13NO_RELEVANT_CONTENT\x10\x06\x12\x1f\n\x1bJAIL_BREAKING_QUERY_IGNORED\x10\x07\x12\x1d\n\x19\x43USTOMER_POLICY_VIOLATION\x10\x08\x12(\n$NON_SUMMARY_SEEKING_QUERY_IGNORED_V2\x10\t\x12\x0c\n\x08TIME_OUT\x10\n\x1aI\n\x12QueryExpansionInfo\x12\x16\n\x0e\x65xpanded_query\x18\x01 \x01(\x08\x12\x1b\n\x13pinned_result_count\x18\x02 \x01(\x03\x1a\xf3\x10\n%NaturalLanguageQueryUnderstandingInfo\x12\x19\n\x11\x65xtracted_filters\x18\x01 \x01(\t\x12\x17\n\x0frewritten_query\x18\x02 \x01(\t\x12\x1a\n\x12\x63lassified_intents\x18\x05 \x03(\t\x12\x94\x01\n\x1bstructured_extracted_filter\x18\x03 \x01(\x0b\x32o.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter\x1a\xe2\x0e\n\x19StructuredExtractedFilter\x12\x8e\x01\n\nexpression\x18\x01 \x01(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1aM\n\x10StringConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0e\n\x06values\x18\x02 \x03(\t\x12\x15\n\rquery_segment\x18\x03 \x01(\t\x1a\xf6\x02\n\x10NumberConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\xa0\x01\n\ncomparison\x18\x02 \x01(\x0e\x32\x8b\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison\x12\r\n\x05value\x18\x03 \x01(\x01\x12\x15\n\rquery_segment\x18\x04 \x01(\t\"\x84\x01\n\nComparison\x12\x1a\n\x16\x43OMPARISON_UNSPECIFIED\x10\x00\x12\n\n\x06\x45QUALS\x10\x01\x12\x14\n\x10LESS_THAN_EQUALS\x10\x02\x12\r\n\tLESS_THAN\x10\x03\x12\x17\n\x13GREATER_THAN_EQUALS\x10\x04\x12\x10\n\x0cGREATER_THAN\x10\x05\x1a{\n\x15GeolocationConstraint\x12\x12\n\nfield_name\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x10\n\x08latitude\x18\x04 \x01(\x01\x12\x11\n\tlongitude\x18\x05 \x01(\x01\x12\x18\n\x10radius_in_meters\x18\x03 \x01(\x02\x1a\xa1\x01\n\rAndExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa0\x01\n\x0cOrExpression\x12\x8f\x01\n\x0b\x65xpressions\x18\x01 \x03(\x0b\x32z.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression\x1a\xa7\x06\n\nExpression\x12\x9e\x01\n\x11string_constraint\x18\x01 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraintH\x00\x12\x9e\x01\n\x11number_constraint\x18\x02 \x01(\x0b\x32\x80\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraintH\x00\x12\xa8\x01\n\x16geolocation_constraint\x18\x03 \x01(\x0b\x32\x85\x01.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraintH\x00\x12\x91\x01\n\x08\x61nd_expr\x18\x04 \x01(\x0b\x32}.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpressionH\x00\x12\x8f\x01\n\x07or_expr\x18\x05 \x01(\x0b\x32|.google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpressionH\x00\x42\x06\n\x04\x65xpr\x1a-\n\x0bSessionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08query_id\x18\x02 \x01(\t\"J\n\rSemanticState\x12\x1e\n\x1aSEMANTIC_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02\x32\x97\x07\n\rSearchService\x12\x8f\x03\n\x06Search\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xa3\x02\x82\xd3\xe4\x93\x02\x9c\x02\"P/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search:\x01*Zc\"^/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search:\x01*Z`\"[/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search:\x01*\x12\x9f\x03\n\nSearchLite\x12..google.cloud.discoveryengine.v1.SearchRequest\x1a/.google.cloud.discoveryengine.v1.SearchResponse\"\xaf\x02\x82\xd3\xe4\x93\x02\xa8\x02\"T/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zg\"b/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:searchLite:\x01*Zd\"_/v1/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:searchLite:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12SearchServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.UserInfo", "google/cloud/discoveryengine/v1/common.proto"], - ["google.protobuf.Value", "google/protobuf/struct.proto"], - ["google.cloud.discoveryengine.v1.Document", "google/cloud/discoveryengine/v1/document.proto"], - ["google.cloud.discoveryengine.v1.Chunk", "google/cloud/discoveryengine/v1/chunk.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - SearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest").msgclass - SearchRequest::ImageQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ImageQuery").msgclass - SearchRequest::DataStoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DataStoreSpec").msgclass - SearchRequest::FacetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.FacetSpec").msgclass - SearchRequest::FacetSpec::FacetKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey").msgclass - SearchRequest::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec").msgclass - SearchRequest::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec").msgclass - SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass - SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass - SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule - SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule - SearchRequest::QueryExpansionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec").msgclass - SearchRequest::QueryExpansionSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition").enummodule - SearchRequest::SpellCorrectionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec").msgclass - SearchRequest::SpellCorrectionSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode").enummodule - SearchRequest::ContentSearchSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec").msgclass - SearchRequest::ContentSearchSpec::SnippetSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SnippetSpec").msgclass - SearchRequest::ContentSearchSpec::SummarySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec").msgclass - SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelPromptSpec").msgclass - SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.ModelSpec").msgclass - SearchRequest::ContentSearchSpec::ExtractiveContentSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ExtractiveContentSpec").msgclass - SearchRequest::ContentSearchSpec::ChunkSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.ChunkSpec").msgclass - SearchRequest::ContentSearchSpec::SearchResultMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode").enummodule - SearchRequest::NaturalLanguageQueryUnderstandingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec").msgclass - SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition").enummodule - SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehavior").enummodule - SearchRequest::SearchAsYouTypeSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec").msgclass - SearchRequest::SearchAsYouTypeSpec::Condition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition").enummodule - SearchRequest::DisplaySpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec").msgclass - SearchRequest::DisplaySpec::MatchHighlightingCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.DisplaySpec.MatchHighlightingCondition").enummodule - SearchRequest::CrowdingSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec").msgclass - SearchRequest::CrowdingSpec::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.CrowdingSpec.Mode").enummodule - SearchRequest::SessionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.SessionSpec").msgclass - SearchRequest::RelevanceScoreSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec").msgclass - SearchRequest::RankingExpressionBackend = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend").enummodule - SearchRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold").enummodule - SearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse").msgclass - SearchResponse::SearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult").msgclass - SearchResponse::SearchResult::RankSignals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals").msgclass - SearchResponse::SearchResult::RankSignals::CustomSignal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal").msgclass - SearchResponse::Facet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet").msgclass - SearchResponse::Facet::FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue").msgclass - SearchResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary").msgclass - SearchResponse::Summary::SafetyAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SafetyAttributes").msgclass - SearchResponse::Summary::CitationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationMetadata").msgclass - SearchResponse::Summary::Citation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Citation").msgclass - SearchResponse::Summary::CitationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.CitationSource").msgclass - SearchResponse::Summary::Reference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference").msgclass - SearchResponse::Summary::Reference::ChunkContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.Reference.ChunkContent").msgclass - SearchResponse::Summary::SummaryWithMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummaryWithMetadata").msgclass - SearchResponse::Summary::SummarySkippedReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.Summary.SummarySkippedReason").enummodule - SearchResponse::QueryExpansionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.QueryExpansionInfo").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.StringConstraint").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.NumberConstraint.Comparison").enummodule - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.GeolocationConstraint").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.AndExpression").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.OrExpression").msgclass - SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.NaturalLanguageQueryUnderstandingInfo.StructuredExtractedFilter.Expression").msgclass - SearchResponse::SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SessionInfo").msgclass - SearchResponse::SemanticState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchResponse.SemanticState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb deleted file mode 100644 index a0f18b166895..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_service_services_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/search_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/search_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchService - # Service for search. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.SearchService' - - # Performs a search. - rpc :Search, ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Google::Cloud::DiscoveryEngine::V1::SearchResponse - # Performs a search. Similar to the - # [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] - # method, but a lite version that allows API key for authentication, where - # OAuth and IAM checks are not required. - # - # Only public website search is supported by this method. If data stores and - # engines not associated with public website search are specified, a - # `FAILED_PRECONDITION` error is returned. - # - # This method can be used for easy onboarding without having to implement an - # authentication backend. However, it is strongly recommended to use - # [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] - # instead with required OAuth and IAM checks to provide better data security. - rpc :SearchLite, ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, ::Google::Cloud::DiscoveryEngine::V1::SearchResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb deleted file mode 100644 index 582f3117b059..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/search_tuning_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/custom_tuning_model_pb' -require 'google/cloud/discoveryengine/v1/import_config_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n;google/cloud/discoveryengine/v1/search_tuning_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/discoveryengine/v1/custom_tuning_model.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"_\n\x17ListCustomModelsRequest\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\"^\n\x18ListCustomModelsResponse\x12\x42\n\x06models\x18\x01 \x03(\x0b\x32\x32.google.cloud.discoveryengine.v1.CustomTuningModel\"\xc2\x03\n\x17TrainCustomModelRequest\x12g\n\x12gcs_training_input\x18\x02 \x01(\x0b\x32I.google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInputH\x00\x12\x44\n\ndata_store\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x12\n\nmodel_type\x18\x03 \x01(\t\x12H\n\x0c\x65rror_config\x18\x04 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x10\n\x08model_id\x18\x05 \x01(\t\x1av\n\x10GcsTrainingInput\x12\x18\n\x10\x63orpus_data_path\x18\x01 \x01(\t\x12\x17\n\x0fquery_data_path\x18\x02 \x01(\t\x12\x17\n\x0ftrain_data_path\x18\x03 \x01(\t\x12\x16\n\x0etest_data_path\x18\x04 \x01(\tB\x10\n\x0etraining_input\"\xc2\x02\n\x18TrainCustomModelResponse\x12)\n\rerror_samples\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\x12H\n\x0c\x65rror_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.discoveryengine.v1.ImportErrorConfig\x12\x14\n\x0cmodel_status\x18\x03 \x01(\t\x12W\n\x07metrics\x18\x04 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.TrainCustomModelResponse.MetricsEntry\x12\x12\n\nmodel_name\x18\x05 \x01(\t\x1a.\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\"|\n\x18TrainCustomModelMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x92\x05\n\x13SearchTuningService\x12\xc3\x02\n\x10TrainCustomModel\x12\x38.google.cloud.discoveryengine.v1.TrainCustomModelRequest\x1a\x1d.google.longrunning.Operation\"\xd5\x01\xca\x41t\n8google.cloud.discoveryengine.v1.TrainCustomModelResponse\x12\x38google.cloud.discoveryengine.v1.TrainCustomModelMetadata\x82\xd3\xe4\x93\x02X\"S/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:trainCustomModel:\x01*\x12\xe0\x01\n\x10ListCustomModels\x12\x38.google.cloud.discoveryengine.v1.ListCustomModelsRequest\x1a\x39.google.cloud.discoveryengine.v1.ListCustomModelsResponse\"W\x82\xd3\xe4\x93\x02Q\x12O/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}/customModels\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8b\x02\n#com.google.cloud.discoveryengine.v1B\x18SearchTuningServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.CustomTuningModel", "google/cloud/discoveryengine/v1/custom_tuning_model.proto"], - ["google.cloud.discoveryengine.v1.ImportErrorConfig", "google/cloud/discoveryengine/v1/import_config.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - ListCustomModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCustomModelsRequest").msgclass - ListCustomModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListCustomModelsResponse").msgclass - TrainCustomModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelRequest").msgclass - TrainCustomModelRequest::GcsTrainingInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelRequest.GcsTrainingInput").msgclass - TrainCustomModelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelResponse").msgclass - TrainCustomModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TrainCustomModelMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb deleted file mode 100644 index 00bbc3467de9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/search_tuning_service_services_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/search_tuning_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/search_tuning_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SearchTuningService - # Service for search tuning. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.SearchTuningService' - - # Trains a custom model. - rpc :TrainCustomModel, ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, ::Google::Longrunning::Operation - # Gets a list of all the custom models. - rpc :ListCustomModels, ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb deleted file mode 100644 index 3cfca5b246b8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/serving_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/common_pb' -require 'google/cloud/discoveryengine/v1/search_service_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/discoveryengine/v1/serving_config.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x34google/cloud/discoveryengine/v1/search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfc\x0b\n\rServingConfig\x12R\n\x0cmedia_config\x18\x07 \x01(\x0b\x32:.google.cloud.discoveryengine.v1.ServingConfig.MediaConfigH\x00\x12V\n\x0egeneric_config\x18\n \x01(\x0b\x32<.google.cloud.discoveryengine.v1.ServingConfig.GenericConfigH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12L\n\rsolution_type\x18\x03 \x01(\x0e\x32-.google.cloud.discoveryengine.v1.SolutionTypeB\x06\xe0\x41\x02\xe0\x41\x05\x12\x10\n\x08model_id\x18\x04 \x01(\t\x12\x17\n\x0f\x64iversity_level\x18\x05 \x01(\t\x12\x1a\n\x12ranking_expression\x18\x15 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\x12\x66ilter_control_ids\x18\x0b \x03(\t\x12\x19\n\x11\x62oost_control_ids\x18\x0c \x03(\t\x12\x1c\n\x14redirect_control_ids\x18\x0e \x03(\t\x12\x1c\n\x14synonyms_control_ids\x18\x0f \x03(\t\x12#\n\x1boneway_synonyms_control_ids\x18\x10 \x03(\t\x12\x1e\n\x16\x64issociate_control_ids\x18\x11 \x03(\t\x12\x1f\n\x17replacement_control_ids\x18\x12 \x03(\t\x12\x1a\n\x12ignore_control_ids\x18\x13 \x03(\t\x12\x1b\n\x13promote_control_ids\x18\x1a \x03(\t\x1a\xf7\x01\n\x0bMediaConfig\x12.\n$content_watched_percentage_threshold\x18\x02 \x01(\x02H\x00\x12+\n!content_watched_seconds_threshold\x18\x05 \x01(\x02H\x00\x12\x1b\n\x13\x64\x65motion_event_type\x18\x01 \x01(\t\x12-\n demote_content_watched_past_days\x18% \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x1d\x63ontent_freshness_cutoff_days\x18\x04 \x01(\x05\x42\x18\n\x16\x64\x65mote_content_watched\x1an\n\rGenericConfig\x12]\n\x13\x63ontent_search_spec\x18\x01 \x01(\x0b\x32@.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec:\x80\x03\xea\x41\xfc\x02\n,discoveryengine.googleapis.com/ServingConfig\x12_projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}\x12xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}\x12qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}B\x11\n\x0fvertical_configB\x85\x02\n#com.google.cloud.discoveryengine.v1B\x12ServingConfigProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec", "google/cloud/discoveryengine/v1/search_service.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - ServingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig").msgclass - ServingConfig::MediaConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig.MediaConfig").msgclass - ServingConfig::GenericConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ServingConfig.GenericConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb deleted file mode 100644 index 88ded488a0c4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/serving_config_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/serving_config_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n.google.cloud.discoveryengine.v1.Session.Turn.QueryConfigEntryB\x03\xe0\x41\x01\x1a\x32\n\x10QueryConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01:\xe6\x02\xea\x41\xe2\x02\n&discoveryengine.googleapis.com/Session\x12Rprojects/{project}/locations/{location}/dataStores/{data_store}/sessions/{session}\x12kprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/sessions/{session}\x12\x64projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}*\x08sessions2\x07session\"9\n\x05Query\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x12\x15\n\x08query_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x42\t\n\x07\x63ontentB\xff\x01\n#com.google.cloud.discoveryengine.v1B\x0cSessionProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.Answer", "google/cloud/discoveryengine/v1/answer.proto"], - ["google.cloud.discoveryengine.v1.AssistAnswer", "google/cloud/discoveryengine/v1/assist_answer.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - Session = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session").msgclass - Session::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session.Turn").msgclass - Session::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Session.State").enummodule - Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Query").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb deleted file mode 100644 index 14561db3cfb8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/session_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/conversational_search_service_pb' -require 'google/cloud/discoveryengine/v1/session_pb' -require 'google/protobuf/empty_pb' - - -descriptor_data = "\n5google/cloud/discoveryengine/v1/session_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x43google/cloud/discoveryengine/v1/conversational_search_service.proto\x1a-google/cloud/discoveryengine/v1/session.proto\x1a\x1bgoogle/protobuf/empty.proto2\xda\x0e\n\x0eSessionService\x12\xf4\x02\n\rCreateSession\x12\x35.google.cloud.discoveryengine.v1.CreateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x81\x02\xda\x41\x0eparent,session\x82\xd3\xe4\x93\x02\xe9\x01\"9/v1/{parent=projects/*/locations/*/dataStores/*}/sessions:\x07sessionZR\"G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions:\x07sessionZO\"D/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions:\x07session\x12\xbd\x02\n\rDeleteSession\x12\x35.google.cloud.discoveryengine.v1.DeleteSessionRequest\x1a\x16.google.protobuf.Empty\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01*9/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI*G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF*D/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\x91\x03\n\rUpdateSession\x12\x35.google.cloud.discoveryengine.v1.UpdateSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\x9e\x02\xda\x41\x13session,update_mask\x82\xd3\xe4\x93\x02\x81\x02\x32\x41/v1/{session.name=projects/*/locations/*/dataStores/*/sessions/*}:\x07sessionZZ2O/v1/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}:\x07sessionZW2L/v1/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}:\x07session\x12\xc9\x02\n\nGetSession\x12\x32.google.cloud.discoveryengine.v1.GetSessionRequest\x1a(.google.cloud.discoveryengine.v1.Session\"\xdc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{name=projects/*/locations/*/dataStores/*/sessions/*}ZI\x12G/v1/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}ZF\x12\x44/v1/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}\x12\xdc\x02\n\x0cListSessions\x12\x34.google.cloud.discoveryengine.v1.ListSessionsRequest\x1a\x35.google.cloud.discoveryengine.v1.ListSessionsResponse\"\xde\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xce\x01\x12\x39/v1/{parent=projects/*/locations/*/dataStores/*}/sessionsZI\x12G/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessionsZF\x12\x44/v1/{parent=projects/*/locations/*/collections/*/engines/*}/sessions\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x86\x02\n#com.google.cloud.discoveryengine.v1B\x13SessionServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb deleted file mode 100644 index 652682c6b529..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/session_service_services_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/session_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/session_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SessionService - # Service for managing Sessions and Session-related resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.SessionService' - - # Creates a Session. - # - # If the [Session][google.cloud.discoveryengine.v1.Session] to create already - # exists, an ALREADY_EXISTS error is returned. - rpc :CreateSession, ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Deletes a Session. - # - # If the [Session][google.cloud.discoveryengine.v1.Session] to delete does - # not exist, a NOT_FOUND error is returned. - rpc :DeleteSession, ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Google::Protobuf::Empty - # Updates a Session. - # - # [Session][google.cloud.discoveryengine.v1.Session] action type cannot be - # changed. If the [Session][google.cloud.discoveryengine.v1.Session] to - # update does not exist, a NOT_FOUND error is returned. - rpc :UpdateSession, ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Gets a Session. - rpc :GetSession, ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Google::Cloud::DiscoveryEngine::V1::Session - # Lists all Sessions by their parent - # [DataStore][google.cloud.discoveryengine.v1.DataStore]. - rpc :ListSessions, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb deleted file mode 100644 index d625b1812b46..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/site_search_engine.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n8google/cloud/discoveryengine/v1/site_search_engine.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x95\x02\n\x10SiteSearchEngine\x12\x0c\n\x04name\x18\x01 \x01(\t:\xf2\x01\xea\x41\xee\x01\n/discoveryengine.googleapis.com/SiteSearchEngine\x12Pprojects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine\x12iprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine\"\xb7\t\n\nTargetSite\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12$\n\x14provided_uri_pattern\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12>\n\x04type\x18\x03 \x01(\x0e\x32\x30.google.cloud.discoveryengine.v1.TargetSite.Type\x12\x18\n\x0b\x65xact_match\x18\x06 \x01(\x08\x42\x03\xe0\x41\x05\x12\"\n\x15generated_uri_pattern\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0froot_domain_uri\x18\n \x01(\tB\x03\xe0\x41\x03\x12Z\n\x16site_verification_info\x18\x07 \x01(\x0b\x32\x35.google.cloud.discoveryengine.v1.SiteVerificationInfoB\x03\xe0\x41\x03\x12X\n\x0findexing_status\x18\x08 \x01(\x0e\x32:.google.cloud.discoveryengine.v1.TargetSite.IndexingStatusB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x0e\x66\x61ilure_reason\x18\t \x01(\x0b\x32\x39.google.cloud.discoveryengine.v1.TargetSite.FailureReasonB\x03\xe0\x41\x03\x1a\xa9\x01\n\rFailureReason\x12_\n\rquota_failure\x18\x01 \x01(\x0b\x32\x46.google.cloud.discoveryengine.v1.TargetSite.FailureReason.QuotaFailureH\x00\x1a,\n\x0cQuotaFailure\x12\x1c\n\x14total_required_quota\x18\x01 \x01(\x03\x42\t\n\x07\x66\x61ilure\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INCLUDE\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02\"\x87\x01\n\x0eIndexingStatus\x12\x1f\n\x1bINDEXING_STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0b\x43\x41NCELLABLE\x10\x05\x12\r\n\tCANCELLED\x10\x06:\xa1\x02\xea\x41\x9d\x02\n)discoveryengine.googleapis.com/TargetSite\x12jprojects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}\x12\x83\x01projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}\"\xa3\x02\n\x14SiteVerificationInfo\x12l\n\x17site_verification_state\x18\x01 \x01(\x0e\x32K.google.cloud.discoveryengine.v1.SiteVerificationInfo.SiteVerificationState\x12/\n\x0bverify_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"l\n\x15SiteVerificationState\x12\'\n#SITE_VERIFICATION_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08VERIFIED\x10\x01\x12\x0e\n\nUNVERIFIED\x10\x02\x12\x0c\n\x08\x45XEMPTED\x10\x03\"\xfb\x02\n\x07Sitemap\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x8f\x02\xea\x41\x8b\x02\n&discoveryengine.googleapis.com/Sitemap\x12\x63projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}\x12|projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}B\x06\n\x04\x66\x65\x65\x64\x42\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15SiteSearchEngineProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - SiteSearchEngine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteSearchEngine").msgclass - TargetSite = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite").msgclass - TargetSite::FailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.FailureReason").msgclass - TargetSite::FailureReason::QuotaFailure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.FailureReason.QuotaFailure").msgclass - TargetSite::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.Type").enummodule - TargetSite::IndexingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TargetSite.IndexingStatus").enummodule - SiteVerificationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteVerificationInfo").msgclass - SiteVerificationInfo::SiteVerificationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SiteVerificationInfo.SiteVerificationState").enummodule - Sitemap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.Sitemap").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb deleted file mode 100644 index 099050a4ed37..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/site_search_engine_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/site_search_engine_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n@google/cloud/discoveryengine/v1/site_search_engine_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/discoveryengine/v1/site_search_engine.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"c\n\x1aGetSiteSearchEngineRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"\xa9\x01\n\x17\x43reateTargetSiteRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x45\n\x0btarget_site\x18\x02 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSiteB\x03\xe0\x41\x02\"|\n\x18\x43reateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb9\x01\n\x1d\x42\x61tchCreateTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12O\n\x08requests\x18\x02 \x03(\x0b\x32\x38.google.cloud.discoveryengine.v1.CreateTargetSiteRequestB\x03\xe0\x41\x02\"W\n\x14GetTargetSiteRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/TargetSite\"`\n\x17UpdateTargetSiteRequest\x12\x45\n\x0btarget_site\x18\x01 \x01(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSiteB\x03\xe0\x41\x02\"|\n\x18UpdateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Z\n\x17\x44\x65leteTargetSiteRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)discoveryengine.googleapis.com/TargetSite\"|\n\x18\x44\x65leteTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x88\x01\n\x16ListTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n\x17ListTargetSitesResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x81\x01\n\x1d\x42\x61tchCreateTargetSiteMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"c\n\x1e\x42\x61tchCreateTargetSitesResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\"\x9f\x01\n\x14\x43reateSitemapRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12>\n\x07sitemap\x18\x02 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.SitemapB\x03\xe0\x41\x02\"T\n\x14\x44\x65leteSitemapRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&discoveryengine.googleapis.com/Sitemap\"\xc2\x02\n\x14\x46\x65tchSitemapsRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12S\n\x07matcher\x18\x02 \x01(\x0b\x32=.google.cloud.discoveryengine.v1.FetchSitemapsRequest.MatcherB\x03\xe0\x41\x01\x1a\x1b\n\x0bUrisMatcher\x12\x0c\n\x04uris\x18\x01 \x03(\t\x1ao\n\x07Matcher\x12Y\n\x0curis_matcher\x18\x01 \x01(\x0b\x32\x41.google.cloud.discoveryengine.v1.FetchSitemapsRequest.UrisMatcherH\x00\x42\t\n\x07matcher\"y\n\x15\x43reateSitemapMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"y\n\x15\x44\x65leteSitemapMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xc8\x01\n\x15\x46\x65tchSitemapsResponse\x12\x61\n\x11sitemaps_metadata\x18\x01 \x03(\x0b\x32\x46.google.cloud.discoveryengine.v1.FetchSitemapsResponse.SitemapMetadata\x1aL\n\x0fSitemapMetadata\x12\x39\n\x07sitemap\x18\x01 \x01(\x0b\x32(.google.cloud.discoveryengine.v1.Sitemap\"v\n\x1f\x45nableAdvancedSiteSearchRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"\"\n EnableAdvancedSiteSearchResponse\"\x84\x01\n EnableAdvancedSiteSearchMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"w\n DisableAdvancedSiteSearchRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\"#\n!DisableAdvancedSiteSearchResponse\"\x85\x01\n!DisableAdvancedSiteSearchMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9a\x01\n\x12RecrawlUrisRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\x04uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1c\n\x0fsite_credential\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\xe8\x03\n\x13RecrawlUrisResponse\x12Y\n\x0f\x66\x61ilure_samples\x18\x01 \x03(\x0b\x32@.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo\x12\x13\n\x0b\x66\x61iled_uris\x18\x02 \x03(\t\x1a\xe0\x02\n\x0b\x46\x61ilureInfo\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12g\n\x0f\x66\x61ilure_reasons\x18\x02 \x03(\x0b\x32N.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason\x1a\xda\x01\n\rFailureReason\x12n\n\x0b\x63orpus_type\x18\x01 \x01(\x0e\x32Y.google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType\x12\x15\n\rerror_message\x18\x02 \x01(\t\"B\n\nCorpusType\x12\x1b\n\x17\x43ORPUS_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45SKTOP\x10\x01\x12\n\n\x06MOBILE\x10\x02\"\x97\x03\n\x13RecrawlUrisMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cinvalid_uris\x18\x03 \x03(\t\x12\x1a\n\x12invalid_uris_count\x18\x08 \x01(\x05\x12\x14\n\x0cnoindex_uris\x18\x0b \x03(\t\x12\x1a\n\x12noindex_uris_count\x18\x0c \x01(\x05\x12&\n\x1euris_not_matching_target_sites\x18\t \x03(\t\x12,\n$uris_not_matching_target_sites_count\x18\n \x01(\x05\x12\x18\n\x10valid_uris_count\x18\x04 \x01(\x05\x12\x15\n\rsuccess_count\x18\x05 \x01(\x05\x12\x15\n\rpending_count\x18\x06 \x01(\x05\x12\x1c\n\x14quota_exceeded_count\x18\x07 \x01(\x05\"h\n\x1d\x42\x61tchVerifyTargetSitesRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\" \n\x1e\x42\x61tchVerifyTargetSitesResponse\"\x82\x01\n\x1e\x42\x61tchVerifyTargetSitesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa2\x01\n$FetchDomainVerificationStatusRequest\x12S\n\x12site_search_engine\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/discoveryengine.googleapis.com/SiteSearchEngine\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x97\x01\n%FetchDomainVerificationStatusResponse\x12\x41\n\x0ctarget_sites\x18\x01 \x03(\x0b\x32+.google.cloud.discoveryengine.v1.TargetSite\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x32\x8f/\n\x17SiteSearchEngineService\x12\xa8\x02\n\x13GetSiteSearchEngine\x12;.google.cloud.discoveryengine.v1.GetSiteSearchEngineRequest\x1a\x31.google.cloud.discoveryengine.v1.SiteSearchEngine\"\xa0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x92\x01\x12?/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine}ZO\x12M/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}\x12\xbb\x03\n\x10\x43reateTargetSite\x12\x38.google.cloud.discoveryengine.v1.CreateTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\xcd\x02\xca\x41\x66\n*google.cloud.discoveryengine.v1.TargetSite\x12\x38google.cloud.discoveryengine.v1.CreateTargetSiteMetadata\xda\x41\x12parent,target_site\x82\xd3\xe4\x93\x02\xc8\x01\"M/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSites:\x0btarget_siteZj\"[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites:\x0btarget_site\x12\xcf\x03\n\x16\x42\x61tchCreateTargetSites\x12>.google.cloud.discoveryengine.v1.BatchCreateTargetSitesRequest\x1a\x1d.google.longrunning.Operation\"\xd5\x02\xca\x41\x7f\n>google.cloud.discoveryengine.v1.BatchCreateTargetSitesResponse\x12=google.cloud.discoveryengine.v1.BatchCreateTargetSiteMetadata\x82\xd3\xe4\x93\x02\xcc\x01\"Y/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSites:batchCreate:\x01*Zl\"g/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites:batchCreate:\x01*\x12\xb2\x02\n\rGetTargetSite\x12\x35.google.cloud.discoveryengine.v1.GetTargetSiteRequest\x1a+.google.cloud.discoveryengine.v1.TargetSite\"\xbc\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xae\x01\x12M/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}Z]\x12[/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}\x12\xcc\x03\n\x10UpdateTargetSite\x12\x38.google.cloud.discoveryengine.v1.UpdateTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\xde\x02\xca\x41\x66\n*google.cloud.discoveryengine.v1.TargetSite\x12\x38google.cloud.discoveryengine.v1.UpdateTargetSiteMetadata\xda\x41\x0btarget_site\x82\xd3\xe4\x93\x02\xe0\x01\x32Y/v1/{target_site.name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}:\x0btarget_siteZv2g/v1/{target_site.name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}:\x0btarget_site\x12\xfe\x02\n\x10\x44\x65leteTargetSite\x12\x38.google.cloud.discoveryengine.v1.DeleteTargetSiteRequest\x1a\x1d.google.longrunning.Operation\"\x90\x02\xca\x41Q\n\x15google.protobuf.Empty\x12\x38google.cloud.discoveryengine.v1.DeleteTargetSiteMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xae\x01*M/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/targetSites/*}Z]*[/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites/*}\x12\xc5\x02\n\x0fListTargetSites\x12\x37.google.cloud.discoveryengine.v1.ListTargetSitesRequest\x1a\x38.google.cloud.discoveryengine.v1.ListTargetSitesResponse\"\xbe\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xae\x01\x12M/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/targetSitesZ]\x12[/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/targetSites\x12\x9d\x03\n\rCreateSitemap\x12\x35.google.cloud.discoveryengine.v1.CreateSitemapRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x02\xca\x41`\n\'google.cloud.discoveryengine.v1.Sitemap\x12\x35google.cloud.discoveryengine.v1.CreateSitemapMetadata\xda\x41\x0eparent,sitemap\x82\xd3\xe4\x93\x02\xba\x01\"J/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/sitemaps:\x07sitemapZc\"X/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/sitemaps:\x07sitemap\x12\xef\x02\n\rDeleteSitemap\x12\x35.google.cloud.discoveryengine.v1.DeleteSitemapRequest\x1a\x1d.google.longrunning.Operation\"\x87\x02\xca\x41N\n\x15google.protobuf.Empty\x12\x35google.cloud.discoveryengine.v1.DeleteSitemapMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa8\x01*J/v1/{name=projects/*/locations/*/dataStores/*/siteSearchEngine/sitemaps/*}ZZ*X/v1/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/sitemaps/*}\x12\xc5\x02\n\rFetchSitemaps\x12\x35.google.cloud.discoveryengine.v1.FetchSitemapsRequest\x1a\x36.google.cloud.discoveryengine.v1.FetchSitemapsResponse\"\xc4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb4\x01\x12P/v1/{parent=projects/*/locations/*/dataStores/*/siteSearchEngine}/sitemaps:fetchZ`\x12^/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}/sitemaps:fetch\x12\xf3\x03\n\x18\x45nableAdvancedSiteSearch\x12@.google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x02\xca\x41\x84\x01\n@google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchResponse\x12@google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchMetadata\x82\xd3\xe4\x93\x02\xe6\x01\"f/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:enableAdvancedSiteSearch:\x01*Zy\"t/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:enableAdvancedSiteSearch:\x01*\x12\xf9\x03\n\x19\x44isableAdvancedSiteSearch\x12\x41.google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x02\xca\x41\x86\x01\nAgoogle.cloud.discoveryengine.v1.DisableAdvancedSiteSearchResponse\x12\x41google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchMetadata\x82\xd3\xe4\x93\x02\xe8\x01\"g/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:disableAdvancedSiteSearch:\x01*Zz\"u/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:disableAdvancedSiteSearch:\x01*\x12\xa4\x03\n\x0bRecrawlUris\x12\x33.google.cloud.discoveryengine.v1.RecrawlUrisRequest\x1a\x1d.google.longrunning.Operation\"\xc0\x02\xca\x41j\n3google.cloud.discoveryengine.v1.RecrawlUrisResponse\x12\x33google.cloud.discoveryengine.v1.RecrawlUrisMetadata\x82\xd3\xe4\x93\x02\xcc\x01\"Y/v1/{site_search_engine=projects/*/locations/*/dataStores/*/siteSearchEngine}:recrawlUris:\x01*Zl\"g/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:recrawlUris:\x01*\x12\xef\x02\n\x16\x42\x61tchVerifyTargetSites\x12>.google.cloud.discoveryengine.v1.BatchVerifyTargetSitesRequest\x1a\x1d.google.longrunning.Operation\"\xf5\x01\xca\x41\x80\x01\n>google.cloud.discoveryengine.v1.BatchVerifyTargetSitesResponse\x12>google.cloud.discoveryengine.v1.BatchVerifyTargetSitesMetadata\x82\xd3\xe4\x93\x02k\"f/v1/{parent=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:batchVerifyTargetSites:\x01*\x12\xb2\x02\n\x1d\x46\x65tchDomainVerificationStatus\x12\x45.google.cloud.discoveryengine.v1.FetchDomainVerificationStatusRequest\x1a\x46.google.cloud.discoveryengine.v1.FetchDomainVerificationStatusResponse\"\x81\x01\x82\xd3\xe4\x93\x02{\x12y/v1/{site_search_engine=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine}:fetchDomainVerificationStatus\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8f\x02\n#com.google.cloud.discoveryengine.v1B\x1cSiteSearchEngineServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.TargetSite", "google/cloud/discoveryengine/v1/site_search_engine.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - GetSiteSearchEngineRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetSiteSearchEngineRequest").msgclass - CreateTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateTargetSiteRequest").msgclass - CreateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateTargetSiteMetadata").msgclass - BatchCreateTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSitesRequest").msgclass - GetTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.GetTargetSiteRequest").msgclass - UpdateTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateTargetSiteRequest").msgclass - UpdateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UpdateTargetSiteMetadata").msgclass - DeleteTargetSiteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteTargetSiteRequest").msgclass - DeleteTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteTargetSiteMetadata").msgclass - ListTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListTargetSitesRequest").msgclass - ListTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListTargetSitesResponse").msgclass - BatchCreateTargetSiteMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSiteMetadata").msgclass - BatchCreateTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchCreateTargetSitesResponse").msgclass - CreateSitemapRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSitemapRequest").msgclass - DeleteSitemapRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSitemapRequest").msgclass - FetchSitemapsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest").msgclass - FetchSitemapsRequest::UrisMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest.UrisMatcher").msgclass - FetchSitemapsRequest::Matcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsRequest.Matcher").msgclass - CreateSitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CreateSitemapMetadata").msgclass - DeleteSitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DeleteSitemapMetadata").msgclass - FetchSitemapsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsResponse").msgclass - FetchSitemapsResponse::SitemapMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchSitemapsResponse.SitemapMetadata").msgclass - EnableAdvancedSiteSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchRequest").msgclass - EnableAdvancedSiteSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchResponse").msgclass - EnableAdvancedSiteSearchMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.EnableAdvancedSiteSearchMetadata").msgclass - DisableAdvancedSiteSearchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchRequest").msgclass - DisableAdvancedSiteSearchResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchResponse").msgclass - DisableAdvancedSiteSearchMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DisableAdvancedSiteSearchMetadata").msgclass - RecrawlUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisRequest").msgclass - RecrawlUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse").msgclass - RecrawlUrisResponse::FailureInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo").msgclass - RecrawlUrisResponse::FailureInfo::FailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason").msgclass - RecrawlUrisResponse::FailureInfo::FailureReason::CorpusType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisResponse.FailureInfo.FailureReason.CorpusType").enummodule - RecrawlUrisMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.RecrawlUrisMetadata").msgclass - BatchVerifyTargetSitesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesRequest").msgclass - BatchVerifyTargetSitesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesResponse").msgclass - BatchVerifyTargetSitesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchVerifyTargetSitesMetadata").msgclass - FetchDomainVerificationStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchDomainVerificationStatusRequest").msgclass - FetchDomainVerificationStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.FetchDomainVerificationStatusResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb deleted file mode 100644 index aba02bad853b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/site_search_engine_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/site_search_engine_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module SiteSearchEngineService - # Service for managing site search related resources. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.SiteSearchEngineService' - - # Gets the - # [SiteSearchEngine][google.cloud.discoveryengine.v1.SiteSearchEngine]. - rpc :GetSiteSearchEngine, ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine - # Creates a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. - rpc :CreateTargetSite, ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, ::Google::Longrunning::Operation - # Creates [TargetSite][google.cloud.discoveryengine.v1.TargetSite] in a - # batch. - rpc :BatchCreateTargetSites, ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, ::Google::Longrunning::Operation - # Gets a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. - rpc :GetTargetSite, ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, ::Google::Cloud::DiscoveryEngine::V1::TargetSite - # Updates a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. - rpc :UpdateTargetSite, ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, ::Google::Longrunning::Operation - # Deletes a [TargetSite][google.cloud.discoveryengine.v1.TargetSite]. - rpc :DeleteTargetSite, ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, ::Google::Longrunning::Operation - # Gets a list of [TargetSite][google.cloud.discoveryengine.v1.TargetSite]s. - rpc :ListTargetSites, ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse - # Creates a [Sitemap][google.cloud.discoveryengine.v1.Sitemap]. - rpc :CreateSitemap, ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Google::Longrunning::Operation - # Deletes a [Sitemap][google.cloud.discoveryengine.v1.Sitemap]. - rpc :DeleteSitemap, ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Google::Longrunning::Operation - # Fetch [Sitemap][google.cloud.discoveryengine.v1.Sitemap]s in a - # [DataStore][google.cloud.discoveryengine.v1.DataStore]. - rpc :FetchSitemaps, ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse - # Upgrade from basic site search to advanced site search. - rpc :EnableAdvancedSiteSearch, ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, ::Google::Longrunning::Operation - # Downgrade from advanced site search to basic site search. - rpc :DisableAdvancedSiteSearch, ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, ::Google::Longrunning::Operation - # Request on-demand recrawl for a list of URIs. - rpc :RecrawlUris, ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, ::Google::Longrunning::Operation - # Verify target sites' ownership and validity. - # This API sends all the target sites under site search engine for - # verification. - rpc :BatchVerifyTargetSites, ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, ::Google::Longrunning::Operation - # Returns list of target sites with its domain verification status. - # This method can only be called under data store with BASIC_SITE_SEARCH - # state at the moment. - rpc :FetchDomainVerificationStatus, ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb deleted file mode 100644 index c9cb80206ee7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/user_event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/common_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/discoveryengine/v1/user_event.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/discoveryengine/v1/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\t\n\tUserEvent\x12\x17\n\nevent_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversion_type\x18\x15 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0euser_pseudo_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06\x65ngine\x18\x13 \x01(\tB*\xfa\x41\'\n%discoveryengine.googleapis.com/Engine\x12\x41\n\ndata_store\x18\x14 \x01(\tB-\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12.\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\tuser_info\x18\x04 \x01(\x0b\x32).google.cloud.discoveryengine.v1.UserInfo\x12\x1b\n\x13\x64irect_user_request\x18\x05 \x01(\x08\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12<\n\tpage_info\x18\x07 \x01(\x0b\x32).google.cloud.discoveryengine.v1.PageInfo\x12\x19\n\x11\x61ttribution_token\x18\x08 \x01(\t\x12\x0e\n\x06\x66ilter\x18\t \x01(\t\x12@\n\tdocuments\x18\n \x03(\x0b\x32-.google.cloud.discoveryengine.v1.DocumentInfo\x12\x39\n\x05panel\x18\x0b \x01(\x0b\x32*.google.cloud.discoveryengine.v1.PanelInfo\x12@\n\x0bsearch_info\x18\x0c \x01(\x0b\x32+.google.cloud.discoveryengine.v1.SearchInfo\x12H\n\x0f\x63ompletion_info\x18\r \x01(\x0b\x32/.google.cloud.discoveryengine.v1.CompletionInfo\x12J\n\x10transaction_info\x18\x0e \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.TransactionInfo\x12\x0f\n\x07tag_ids\x18\x0f \x03(\t\x12\x15\n\rpromotion_ids\x18\x10 \x03(\t\x12N\n\nattributes\x18\x11 \x03(\x0b\x32:.google.cloud.discoveryengine.v1.UserEvent.AttributesEntry\x12>\n\nmedia_info\x18\x12 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.MediaInfo\x12?\n\x06panels\x18\x16 \x03(\x0b\x32*.google.cloud.discoveryengine.v1.PanelInfoB\x03\xe0\x41\x01\x1a\x63\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.discoveryengine.v1.CustomAttribute:\x02\x38\x01\"Y\n\x08PageInfo\x12\x13\n\x0bpageview_id\x18\x01 \x01(\t\x12\x15\n\rpage_category\x18\x02 \x01(\t\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12\x14\n\x0creferrer_uri\x18\x04 \x01(\t\"T\n\nSearchInfo\x12\x14\n\x0csearch_query\x18\x01 \x01(\t\x12\x10\n\x08order_by\x18\x02 \x01(\t\x12\x13\n\x06offset\x18\x03 \x01(\x05H\x00\x88\x01\x01\x42\t\n\x07_offset\"H\n\x0e\x43ompletionInfo\x12\x1b\n\x13selected_suggestion\x18\x01 \x01(\t\x12\x19\n\x11selected_position\x18\x02 \x01(\x05\"\xc9\x01\n\x0fTransactionInfo\x12\x17\n\x05value\x18\x01 \x01(\x02\x42\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x15\n\x08\x63urrency\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0etransaction_id\x18\x03 \x01(\t\x12\x10\n\x03tax\x18\x04 \x01(\x02H\x01\x88\x01\x01\x12\x11\n\x04\x63ost\x18\x05 \x01(\x02H\x02\x88\x01\x01\x12\x1b\n\x0e\x64iscount_value\x18\x06 \x01(\x02H\x03\x88\x01\x01\x42\x08\n\x06_valueB\x06\n\x04_taxB\x07\n\x05_costB\x11\n\x0f_discount_value\"\x89\x02\n\x0c\x44ocumentInfo\x12\x0c\n\x02id\x18\x01 \x01(\tH\x00\x12<\n\x04name\x18\x02 \x01(\tB,\xfa\x41)\n\'discoveryengine.googleapis.com/DocumentH\x00\x12\r\n\x03uri\x18\x06 \x01(\tH\x00\x12\x15\n\x08quantity\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\rpromotion_ids\x18\x04 \x03(\t\x12\x13\n\x06joined\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\"\n\x10\x63onversion_value\x18\x07 \x01(\x02\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13\x64ocument_descriptorB\x0b\n\t_quantityB\x13\n\x11_conversion_value\"\xdb\x01\n\tPanelInfo\x12\x15\n\x08panel_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x1b\n\x0epanel_position\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x19\n\x0ctotal_panels\x18\x05 \x01(\x05H\x01\x88\x01\x01\x12\x45\n\tdocuments\x18\x06 \x03(\x0b\x32-.google.cloud.discoveryengine.v1.DocumentInfoB\x03\xe0\x41\x01\x42\x11\n\x0f_panel_positionB\x0f\n\r_total_panels\"\x8d\x01\n\tMediaInfo\x12:\n\x17media_progress_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12&\n\x19media_progress_percentage\x18\x02 \x01(\x02H\x00\x88\x01\x01\x42\x1c\n\x1a_media_progress_percentageB\x81\x02\n#com.google.cloud.discoveryengine.v1B\x0eUserEventProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.discoveryengine.v1.UserInfo", "google/cloud/discoveryengine/v1/common.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - UserEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserEvent").msgclass - PageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PageInfo").msgclass - SearchInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.SearchInfo").msgclass - CompletionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CompletionInfo").msgclass - TransactionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.TransactionInfo").msgclass - DocumentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.DocumentInfo").msgclass - PanelInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.PanelInfo").msgclass - MediaInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.MediaInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb deleted file mode 100644 index 7304fc75125a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/user_event_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/httpbody_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/import_config_pb' -require 'google/cloud/discoveryengine/v1/purge_config_pb' -require 'google/cloud/discoveryengine/v1/user_event_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n8google/cloud/discoveryengine/v1/user_event_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/discoveryengine/v1/import_config.proto\x1a\x32google/cloud/discoveryengine/v1/purge_config.proto\x1a\x30google/cloud/discoveryengine/v1/user_event.proto\x1a#google/longrunning/operations.proto\"\xc7\x01\n\x15WriteUserEventRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12H\n\nuser_event\x18\x02 \x01(\x0b\x32*.google.cloud.discoveryengine.v1.UserEventB\x03\xe0\x41\x02H\x00\x88\x01\x01\x12\x13\n\x0bwrite_async\x18\x03 \x01(\x08\x42\r\n\x0b_user_event\"\xa8\x01\n\x17\x43ollectUserEventRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12\x17\n\nuser_event\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03\x65ts\x18\x04 \x01(\x03H\x01\x88\x01\x01\x42\x06\n\x04_uriB\x06\n\x04_ets2\xec\x0c\n\x10UserEventService\x12\xf0\x02\n\x0eWriteUserEvent\x12\x36.google.cloud.discoveryengine.v1.WriteUserEventRequest\x1a*.google.cloud.discoveryengine.v1.UserEvent\"\xf9\x01\x82\xd3\xe4\x93\x02\xf2\x01\"A/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:write:\nuser_eventZ]\"O/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:write:\nuser_eventZB\"4/v1/{parent=projects/*/locations/*}/userEvents:write:\nuser_event\x12\xc0\x02\n\x10\x43ollectUserEvent\x12\x38.google.cloud.discoveryengine.v1.CollectUserEventRequest\x1a\x14.google.api.HttpBody\"\xdb\x01\x82\xd3\xe4\x93\x02\xd4\x01\x12\x43/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:collectZS\x12Q/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collectZ8\x12\x36/v1/{parent=projects/*/locations/*}/userEvents:collect\x12\x84\x03\n\x0fPurgeUserEvents\x12\x37.google.cloud.discoveryengine.v1.PurgeUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\x98\x02\xca\x41r\n7google.cloud.discoveryengine.v1.PurgeUserEventsResponse\x12\x37google.cloud.discoveryengine.v1.PurgeUserEventsMetadata\x82\xd3\xe4\x93\x02\x9c\x01\"A/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:purge:\x01*ZT\"O/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:purge:\x01*\x12\xc6\x03\n\x10ImportUserEvents\x12\x38.google.cloud.discoveryengine.v1.ImportUserEventsRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x02\xca\x41t\n8google.cloud.discoveryengine.v1.ImportUserEventsResponse\x12\x38google.cloud.discoveryengine.v1.ImportUserEventsMetadata\x82\xd3\xe4\x93\x02\xda\x01\"B/v1/{parent=projects/*/locations/*/dataStores/*}/userEvents:import:\x01*ZU\"P/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:import:\x01*Z:\"5/v1/{parent=projects/*/locations/*}/userEvents:import:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x88\x02\n#com.google.cloud.discoveryengine.v1B\x15UserEventServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.UserEvent", "google/cloud/discoveryengine/v1/user_event.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - WriteUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.WriteUserEventRequest").msgclass - CollectUserEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.CollectUserEventRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb deleted file mode 100644 index 1d36aa174fa2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/user_event_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/user_event_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserEventService - # Service for ingesting end user actions on a website to Discovery Engine API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.UserEventService' - - # Writes a single user event. - rpc :WriteUserEvent, ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, ::Google::Cloud::DiscoveryEngine::V1::UserEvent - # 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, ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, ::Google::Api::HttpBody - # 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, ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, ::Google::Longrunning::Operation - # 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, ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb deleted file mode 100644 index 48d43125af75..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/user_license.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/discoveryengine/v1/user_license.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbb\x04\n\x0bUserLicense\x12\x1e\n\x0euser_principal\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x19\n\x0cuser_profile\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12j\n\x18license_assignment_state\x18\x04 \x01(\x0e\x32\x43.google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentStateB\x03\xe0\x41\x03\x12L\n\x0elicense_config\x18\x05 \x01(\tB4\xe0\x41\x01\xfa\x41.\n,discoveryengine.googleapis.com/LicenseConfig\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x0flast_login_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\x90\x01\n\x16LicenseAssignmentState\x12(\n$LICENSE_ASSIGNMENT_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41SSIGNED\x10\x01\x12\x0e\n\nUNASSIGNED\x10\x02\x12\x0e\n\nNO_LICENSE\x10\x03\x12\x1e\n\x1aNO_LICENSE_ATTEMPTED_LOGIN\x10\x04\x42\x83\x02\n#com.google.cloud.discoveryengine.v1B\x10UserLicenseProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - UserLicense = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserLicense").msgclass - UserLicense::LicenseAssignmentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb deleted file mode 100644 index 731bd218da25..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/discoveryengine/v1/user_license_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/discoveryengine/v1/user_license_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n:google/cloud/discoveryengine/v1/user_license_service.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/discoveryengine/v1/user_license.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa1\x01\n\x17ListUserLicensesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/UserStore\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"x\n\x18ListUserLicensesResponse\x12\x43\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicense\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x03\n\x1e\x42\x61tchUpdateUserLicensesRequest\x12\x65\n\rinline_source\x18\x02 \x01(\x0b\x32L.google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest.InlineSourceH\x00\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(discoveryengine.googleapis.com/UserStore\x12,\n\x1f\x64\x65lete_unassigned_user_licenses\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x8e\x01\n\x0cInlineSource\x12H\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicenseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x42\x08\n\x06source\"\xb1\x01\n\x1f\x42\x61tchUpdateUserLicensesMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\rsuccess_count\x18\x03 \x01(\x03\x12\x15\n\rfailure_count\x18\x04 \x01(\x03\"\x91\x01\n\x1f\x42\x61tchUpdateUserLicensesResponse\x12\x43\n\ruser_licenses\x18\x01 \x03(\x0b\x32,.google.cloud.discoveryengine.v1.UserLicense\x12)\n\rerror_samples\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status2\x9a\x05\n\x12UserLicenseService\x12\xd7\x01\n\x10ListUserLicenses\x12\x38.google.cloud.discoveryengine.v1.ListUserLicensesRequest\x1a\x39.google.cloud.discoveryengine.v1.ListUserLicensesResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/userStores/*}/userLicenses\x12\xd5\x02\n\x17\x42\x61tchUpdateUserLicenses\x12?.google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x01\xca\x41\x82\x01\n?google.cloud.discoveryengine.v1.BatchUpdateUserLicensesResponse\x12?google.cloud.discoveryengine.v1.BatchUpdateUserLicensesMetadata\x82\xd3\xe4\x93\x02M\"H/v1/{parent=projects/*/locations/*/userStores/*}:batchUpdateUserLicenses:\x01*\x1aR\xca\x41\x1e\x64iscoveryengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8a\x02\n#com.google.cloud.discoveryengine.v1B\x17UserLicenseServiceProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0f\x44ISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.discoveryengine.v1.UserLicense", "google/cloud/discoveryengine/v1/user_license.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module DiscoveryEngine - module V1 - ListUserLicensesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListUserLicensesRequest").msgclass - ListUserLicensesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.ListUserLicensesResponse").msgclass - BatchUpdateUserLicensesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest").msgclass - BatchUpdateUserLicensesRequest::InlineSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesRequest.InlineSource").msgclass - BatchUpdateUserLicensesMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesMetadata").msgclass - BatchUpdateUserLicensesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.discoveryengine.v1.BatchUpdateUserLicensesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb deleted file mode 100644 index 4991b3aec63d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/discoveryengine/v1/user_license_service.proto for package 'Google.Cloud.DiscoveryEngine.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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. -# - -require 'grpc' -require 'google/cloud/discoveryengine/v1/user_license_service_pb' - -module Google - module Cloud - module DiscoveryEngine - module V1 - module UserLicenseService - # Service for managing User Licenses. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.discoveryengine.v1.UserLicenseService' - - # Lists the User Licenses. - rpc :ListUserLicenses, ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse - # Updates the User License. - # This method is used for batch assign/unassign licenses to users. - rpc :BatchUpdateUserLicenses, ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md deleted file mode 100644 index ce0aac5f06a0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Discovery Engine V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb deleted file mode 100644 index 938f7ac6b2fd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/httpbody.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Message that represents an arbitrary HTTP body. It should only be used for - # payload formats that can't be represented as JSON, such as raw binary or - # an HTML page. - # - # - # This message can be used both in streaming and non-streaming API methods in - # the request as well as the response. - # - # It can be used as a top-level request field, which is convenient if one - # wants to extract parameters from either the URL or HTTP template into the - # request fields and also want access to the raw HTTP body. - # - # Example: - # - # message GetResourceRequest { - # // A unique request id. - # string request_id = 1; - # - # // The raw HTTP body is bound to this field. - # google.api.HttpBody http_body = 2; - # - # } - # - # service ResourceService { - # rpc GetResource(GetResourceRequest) - # returns (google.api.HttpBody); - # rpc UpdateResource(google.api.HttpBody) - # returns (google.protobuf.Empty); - # - # } - # - # Example with streaming methods: - # - # service CaldavService { - # rpc GetCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # rpc UpdateCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # - # } - # - # Use of this type only changes how the request and response bodies are - # handled, all other features will continue to work unchanged. - # @!attribute [rw] content_type - # @return [::String] - # The HTTP Content-Type header value specifying the content type of the body. - # @!attribute [rw] data - # @return [::String] - # The HTTP request/response body as raw binary. - # @!attribute [rw] extensions - # @return [::Array<::Google::Protobuf::Any>] - # Application specific response metadata. Must be set in the first response - # for streaming APIs. - class HttpBody - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb deleted file mode 100644 index 4523dacde51a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/answer.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Defines an answer. - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*` - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::State] - # The state of the answer generation. - # @!attribute [rw] answer_text - # @return [::String] - # The textual answer. - # @!attribute [rw] grounding_score - # @return [::Float] - # A score in the range of [0, 1] describing how grounded the answer is by the - # reference chunks. - # @!attribute [rw] citations - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Citation>] - # Citations. - # @!attribute [rw] grounding_supports - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::GroundingSupport>] - # Optional. Grounding supports. - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Reference>] - # References. - # @!attribute [rw] related_questions - # @return [::Array<::String>] - # Suggested related questions. - # @!attribute [rw] steps - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step>] - # Answer generation steps. - # @!attribute [rw] query_understanding_info - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo] - # Query understanding information. - # @!attribute [rw] answer_skipped_reasons - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::AnswerSkippedReason>] - # Additional answer-skipped reasons. This provides the reason for ignored - # cases. If nothing is skipped, this field is not set. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Answer creation timestamp. - # @!attribute [r] complete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Answer completed timestamp. - # @!attribute [rw] safety_ratings - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SafetyRating>] - # Optional. Safety ratings. - class Answer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Citation info for a segment. - # @!attribute [rw] start_index - # @return [::Integer] - # Index indicates the start of the segment, measured in bytes (UTF-8 - # unicode). If there are multi-byte characters,such as non-ASCII - # characters, the index measurement is longer than the string length. - # @!attribute [rw] end_index - # @return [::Integer] - # End of the attributed segment, exclusive. Measured in bytes (UTF-8 - # unicode). If there are multi-byte characters,such as non-ASCII - # characters, the index measurement is longer than the string length. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::CitationSource>] - # Citation sources for the attributed segment. - class Citation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Citation source. - # @!attribute [rw] reference_id - # @return [::String] - # ID of the citation source. - class CitationSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Grounding support for a claim in `answer_text`. - # @!attribute [rw] start_index - # @return [::Integer] - # Required. Index indicates the start of the claim, measured in bytes - # (UTF-8 unicode). - # @!attribute [rw] end_index - # @return [::Integer] - # Required. End of the claim, exclusive. - # @!attribute [rw] grounding_score - # @return [::Float] - # A score in the range of [0, 1] describing how grounded is a specific - # claim by the references. - # Higher value means that the claim is better supported by the reference - # chunks. - # @!attribute [rw] grounding_check_required - # @return [::Boolean] - # Indicates that this claim required grounding check. When the - # system decided this claim didn't require attribution/grounding check, - # this field is set to false. In that case, no grounding check was - # done for the claim and therefore `grounding_score`, `sources` is not - # returned. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::CitationSource>] - # Optional. Citation sources for the claim. - class GroundingSupport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Reference. - # @!attribute [rw] unstructured_document_info - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::UnstructuredDocumentInfo] - # Unstructured document information. - # - # Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`, `structured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] chunk_info - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::ChunkInfo] - # Chunk information. - # - # Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`, `structured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] structured_document_info - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::StructuredDocumentInfo] - # Structured document information. - # - # Note: The following fields are mutually exclusive: `structured_document_info`, `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Reference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Unstructured document information. - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] uri - # @return [::String] - # URI for the document. - # @!attribute [rw] title - # @return [::String] - # Title. - # @!attribute [rw] chunk_contents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::UnstructuredDocumentInfo::ChunkContent>] - # List of cited chunk contents derived from document content. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # The structured JSON metadata for the document. - # It is populated from the struct data from the Chunk in search result. - class UnstructuredDocumentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Chunk content. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] relevance_score - # @return [::Float] - # The relevance of the chunk for a given query. Values range from 0.0 - # (completely irrelevant) to 1.0 (completely relevant). - # This value is for informational purpose only. It may change for - # the same query and chunk at any time due to a model retraining or - # change in implementation. - class ChunkContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Chunk information. - # @!attribute [rw] chunk - # @return [::String] - # Chunk resource name. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. - # @!attribute [rw] relevance_score - # @return [::Float] - # The relevance of the chunk for a given query. Values range from 0.0 - # (completely irrelevant) to 1.0 (completely relevant). - # This value is for informational purpose only. It may change for - # the same query and chunk at any time due to a model retraining or - # change in implementation. - # @!attribute [rw] document_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Reference::ChunkInfo::DocumentMetadata] - # Document metadata. - class ChunkInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document metadata. - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] uri - # @return [::String] - # URI for the document. - # @!attribute [rw] title - # @return [::String] - # Title. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # The structured JSON metadata for the document. - # It is populated from the struct data from the Chunk in search result. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Structured search information. - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # Structured search data. - # @!attribute [r] title - # @return [::String] - # Output only. The title of the document. - # @!attribute [r] uri - # @return [::String] - # Output only. The URI of the document. - class StructuredDocumentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Step information. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::State] - # The state of the step. - # @!attribute [rw] description - # @return [::String] - # The description of the step. - # @!attribute [rw] thought - # @return [::String] - # The thought of the step. - # @!attribute [rw] actions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action>] - # Actions. - class Step - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Action. - # @!attribute [rw] search_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::SearchAction] - # Search action. - # @!attribute [rw] observation - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation] - # Observation. - class Action - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Search action. - # @!attribute [rw] query - # @return [::String] - # The query to search. - class SearchAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Observation. - # @!attribute [rw] search_results - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult>] - # Search results observed by the search action, it can be snippets info - # or chunk info, depending on the citation type set by the user. - class Observation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] uri - # @return [::String] - # URI for the document. - # @!attribute [rw] title - # @return [::String] - # Title. - # @!attribute [rw] snippet_info - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult::SnippetInfo>] - # If citation_type is DOCUMENT_LEVEL_CITATION, populate document - # level snippets. - # @!attribute [rw] chunk_info - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::Step::Action::Observation::SearchResult::ChunkInfo>] - # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, - # populate chunk info. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # Data representation. - # The structured JSON data for the document. - # It's populated from the struct data from the Document, or the - # Chunk in search result. - class SearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Snippet information. - # @!attribute [rw] snippet - # @return [::String] - # Snippet content. - # @!attribute [rw] snippet_status - # @return [::String] - # Status of the snippet defined by the search team. - class SnippetInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Chunk information. - # @!attribute [rw] chunk - # @return [::String] - # Chunk resource name. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. - # @!attribute [rw] relevance_score - # @return [::Float] - # The relevance of the chunk for a given query. Values range from - # 0.0 (completely irrelevant) to 1.0 (completely relevant). - # This value is for informational purpose only. It may change for - # the same query and chunk at any time due to a model retraining or - # change in implementation. - class ChunkInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - - # Enumeration of the state of the step. - module State - # Unknown. - STATE_UNSPECIFIED = 0 - - # Step is currently in progress. - IN_PROGRESS = 1 - - # Step currently failed. - FAILED = 2 - - # Step has succeeded. - SUCCEEDED = 3 - end - end - - # Query understanding information. - # @!attribute [rw] query_classification_info - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo::QueryClassificationInfo>] - # Query classification information. - class QueryUnderstandingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query classification information. - # @!attribute [rw] type - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer::QueryUnderstandingInfo::QueryClassificationInfo::Type] - # Query classification type. - # @!attribute [rw] positive - # @return [::Boolean] - # Classification output. - class QueryClassificationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query classification types. - module Type - # Unspecified query classification type. - TYPE_UNSPECIFIED = 0 - - # Adversarial query classification type. - ADVERSARIAL_QUERY = 1 - - # Non-answer-seeking query classification type, for chit chat. - NON_ANSWER_SEEKING_QUERY = 2 - - # Jail-breaking query classification type. - JAIL_BREAKING_QUERY = 3 - - # Non-answer-seeking query classification type, for no clear intent. - NON_ANSWER_SEEKING_QUERY_V2 = 4 - - # User defined query classification type. - USER_DEFINED_CLASSIFICATION_QUERY = 5 - end - end - end - - # Enumeration of the state of the answer generation. - module State - # Unknown. - STATE_UNSPECIFIED = 0 - - # Answer generation is currently in progress. - IN_PROGRESS = 1 - - # Answer generation currently failed. - FAILED = 2 - - # Answer generation has succeeded. - SUCCEEDED = 3 - - # Answer generation is currently in progress. - STREAMING = 4 - end - - # An enum for answer skipped reasons. - module AnswerSkippedReason - # Default value. The answer skipped reason is not specified. - ANSWER_SKIPPED_REASON_UNSPECIFIED = 0 - - # The adversarial query ignored case. - ADVERSARIAL_QUERY_IGNORED = 1 - - # The non-answer seeking query ignored case - # - # Google skips the answer if the query is chit chat. - NON_ANSWER_SEEKING_QUERY_IGNORED = 2 - - # The out-of-domain query ignored case. - # - # Google skips the answer if there are no high-relevance search results. - OUT_OF_DOMAIN_QUERY_IGNORED = 3 - - # The potential policy violation case. - # - # Google skips the answer if there is a potential policy violation - # detected. This includes content that may be violent or toxic. - POTENTIAL_POLICY_VIOLATION = 4 - - # The no relevant content case. - # - # Google skips the answer if there is no relevant content in the - # retrieved search results. - NO_RELEVANT_CONTENT = 5 - - # The jail-breaking query ignored case. - # - # For example, "Reply in the tone of a competing company's CEO". - # Google skips the answer if the query is classified as a jail-breaking - # query. - JAIL_BREAKING_QUERY_IGNORED = 6 - - # The customer policy violation case. - # - # Google skips the summary if there is a customer policy violation - # detected. The policy is defined by the customer. - CUSTOMER_POLICY_VIOLATION = 7 - - # The non-answer seeking query ignored case. - # - # Google skips the answer if the query doesn't have clear intent. - NON_ANSWER_SEEKING_QUERY_IGNORED_V2 = 8 - - # The low-grounded answer case. - # - # Google skips the answer if a well grounded answer was unable to be - # generated. - LOW_GROUNDED_ANSWER = 9 - - # The user defined query classification ignored case. - # - # Google skips the answer if the query is classified as a user defined - # query classification. - USER_DEFINED_CLASSIFICATION_QUERY_IGNORED = 10 - - # The unhelpful answer case. - # - # Google skips the answer if the answer is not helpful. This can be due to - # a variety of factors, including but not limited to: the query is not - # answerable, the answer is not relevant to the query, or the answer is - # not well-formatted. - UNHELPFUL_ANSWER = 11 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb deleted file mode 100644 index d6f8953ca64c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assist_answer.rb +++ /dev/null @@ -1,278 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # AssistAnswer resource, main part of - # [AssistResponse][google.cloud.discoveryengine.v1.AssistResponse]. - # @!attribute [rw] name - # @return [::String] - # Immutable. Resource name of the `AssistAnswer`. - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` - # - # This field must be a UTF-8 encoded string with a length limit of 1024 - # characters. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::State] - # State of the answer generation. - # @!attribute [rw] replies - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::Reply>] - # Replies of the assistant. - # @!attribute [rw] assist_skipped_reasons - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistAnswer::AssistSkippedReason>] - # Reasons for not answering the assist call. - class AssistAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # One part of the multi-part response of the assist call. - # @!attribute [rw] grounded_content - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent] - # Possibly grounded response text or media from the assistant. - class Reply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # State of the answer generation. - module State - # Unknown. - STATE_UNSPECIFIED = 0 - - # Assist operation is currently in progress. - IN_PROGRESS = 1 - - # Assist operation has failed. - FAILED = 2 - - # Assist operation has succeeded. - SUCCEEDED = 3 - - # Assist operation has been skipped. - SKIPPED = 4 - end - - # Possible reasons for not answering an assist call. - module AssistSkippedReason - # Default value. Skip reason is not specified. - ASSIST_SKIPPED_REASON_UNSPECIFIED = 0 - - # The assistant ignored the query, because it did not appear to be - # answer-seeking. - NON_ASSIST_SEEKING_QUERY_IGNORED = 1 - - # The assistant ignored the query or refused to answer because of a - # customer policy violation (e.g., the query or the answer contained a - # banned phrase). - CUSTOMER_POLICY_VIOLATION = 2 - end - end - - # Multi-modal content. - # @!attribute [rw] text - # @return [::String] - # Inline text. - # - # Note: The following fields are mutually exclusive: `text`, `inline_data`, `file`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_data - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::Blob] - # Inline binary data. - # - # Note: The following fields are mutually exclusive: `inline_data`, `text`, `file`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] file - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::File] - # A file, e.g., an audio summary. - # - # Note: The following fields are mutually exclusive: `file`, `text`, `inline_data`, `executable_code`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] executable_code - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::ExecutableCode] - # Code generated by the model that is meant to be executed. - # - # Note: The following fields are mutually exclusive: `executable_code`, `text`, `inline_data`, `file`, `code_execution_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] code_execution_result - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::CodeExecutionResult] - # Result of executing an ExecutableCode. - # - # Note: The following fields are mutually exclusive: `code_execution_result`, `text`, `inline_data`, `file`, `executable_code`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] role - # @return [::String] - # The producer of the content. Can be "model" or "user". - # @!attribute [rw] thought - # @return [::Boolean] - # Optional. Indicates if the part is thought from the model. - class AssistantContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Inline blob. - # @!attribute [rw] mime_type - # @return [::String] - # Required. The media type (MIME type) of the generated data. - # @!attribute [rw] data - # @return [::String] - # Required. Raw bytes. - class Blob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A file, e.g., an audio summary. - # @!attribute [rw] mime_type - # @return [::String] - # Required. The media type (MIME type) of the file. - # @!attribute [rw] file_id - # @return [::String] - # Required. The file ID. - class File - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Code generated by the model that is meant to be executed by the model. - # @!attribute [rw] code - # @return [::String] - # Required. The code content. Currently only supports Python. - class ExecutableCode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Result of executing ExecutableCode. - # @!attribute [rw] outcome - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent::CodeExecutionResult::Outcome] - # Required. Outcome of the code execution. - # @!attribute [rw] output - # @return [::String] - # Optional. Contains stdout when code execution is successful, stderr or - # other description otherwise. - class CodeExecutionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of possible outcomes of the code execution. - module Outcome - # Unspecified status. This value should not be used. - OUTCOME_UNSPECIFIED = 0 - - # Code execution completed successfully. - OUTCOME_OK = 1 - - # Code execution finished but with a failure. `stderr` should contain the - # reason. - OUTCOME_FAILED = 2 - - # Code execution ran for too long, and was cancelled. There may or may - # not be a partial output present. - OUTCOME_DEADLINE_EXCEEDED = 3 - end - end - end - - # A piece of content and possibly its grounding information. - # - # Not all content needs grounding. Phrases like "Of course, I will gladly - # search it for you." do not need grounding. - # @!attribute [rw] text_grounding_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata] - # Metadata for grounding based on text sources. - # @!attribute [rw] content - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantContent] - # The content. - class AssistantGroundedContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Grounding details for text sources. - # @!attribute [rw] segments - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Segment>] - # Grounding information for parts of the text. - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Reference>] - # References for the grounded text. - class TextGroundingMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Grounding information for a segment of the text. - # @!attribute [rw] start_index - # @return [::Integer] - # Zero-based index indicating the start of the segment, measured in bytes - # of a UTF-8 string (i.e. characters encoded on multiple bytes have a - # length of more than one). - # @!attribute [rw] end_index - # @return [::Integer] - # End of the segment, exclusive. - # @!attribute [rw] reference_indices - # @return [::Array<::Integer>] - # References for the segment. - # @!attribute [rw] grounding_score - # @return [::Float] - # Score for the segment. - # @!attribute [rw] text - # @return [::String] - # The text segment itself. - class Segment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Referenced content and related document metadata. - # @!attribute [rw] content - # @return [::String] - # Referenced text content. - # @!attribute [rw] document_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistantGroundedContent::TextGroundingMetadata::Reference::DocumentMetadata] - # Document metadata. - class Reference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document metadata. - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] uri - # @return [::String] - # URI for the document. It may contain a URL that redirects to the - # actual website. - # @!attribute [rw] title - # @return [::String] - # Title. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] domain - # @return [::String] - # Domain name from the document URI. Note that the `uri` field may - # contain a URL that redirects to the actual website, in which case - # this will contain the domain name of the target site. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb deleted file mode 100644 index b25f47b4c46a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Discovery Engine Assistant resource. - # @!attribute [rw] name - # @return [::String] - # Immutable. Resource name of the assistant. - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` - # - # It must be a UTF-8 encoded string with a length limit of 1024 characters. - class Assistant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb deleted file mode 100644 index 53b98459c097..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/assistant_service.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # User metadata of the request. - # @!attribute [rw] time_zone - # @return [::String] - # Optional. IANA time zone, e.g. Europe/Budapest. - # @!attribute [rw] preferred_language_code - # @return [::String] - # Optional. Preferred language to be used for answering if language detection - # fails. Also used as the language of error messages created by actions, - # regardless of language detection results. - class AssistUserMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist AssistantService.StreamAssist} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::Assistant Assistant}. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` - # @!attribute [rw] query - # @return [::Google::Cloud::DiscoveryEngine::V1::Query] - # Optional. Current user query. - # - # Empty query is only supported if `file_ids` are provided. In this case, the - # answer will be generated based on those context files. - # @!attribute [rw] session - # @return [::String] - # Optional. The session to use for the request. If specified, the assistant - # has access to the session history, and the query and the answer are stored - # there. - # - # If `-` is specified as the session ID, or it is left empty, then a new - # session is created with an automatically generated ID. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}` - # @!attribute [rw] user_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata] - # Optional. Information about the user initiating the query. - # @!attribute [rw] tools_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec] - # Optional. Specification of tools that are used to serve the request. - # @!attribute [rw] generation_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec] - # Optional. Specification of the generation configuration for the request. - class StreamAssistRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specification of tools that are used to serve the request. - # @!attribute [rw] vertex_ai_search_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::VertexAiSearchSpec] - # Optional. Specification of the Vertex AI Search tool. - # @!attribute [rw] web_grounding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::WebGroundingSpec] - # Optional. Specification of the web grounding tool. - # If field is present, enables grounding with web search. Works only if - # [Assistant.web_grounding_type][google.cloud.discoveryengine.v1.Assistant.web_grounding_type] - # is [WEB_GROUNDING_TYPE_GOOGLE_SEARCH][] or - # [WEB_GROUNDING_TYPE_ENTERPRISE_WEB_SEARCH][]. - # @!attribute [rw] image_generation_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::ImageGenerationSpec] - # Optional. Specification of the image generation tool. - # @!attribute [rw] video_generation_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec::VideoGenerationSpec] - # Optional. Specification of the video generation tool. - class ToolsSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specification of the Vertex AI Search tool. - # @!attribute [rw] data_store_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] - # Optional. Specs defining - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to filter on in - # a search call and configurations for those data stores. This is only - # considered for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with - # multiple data stores. - # @!attribute [rw] filter - # @return [::String] - # Optional. 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to - # a key property defined in the Vertex AI Search backend -- this mapping - # is defined by the customer in their schema. For example a media - # customer might have a field 'name' in their schema. In this case the - # filter would look like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - class VertexAiSearchSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification of the web grounding tool. - class WebGroundingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification of the image generation tool. - class ImageGenerationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification of the video generation tool. - class VideoGenerationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Assistant generation specification for the request. - # This allows to override the default generation configuration at the engine - # level. - # @!attribute [rw] model_id - # @return [::String] - # Optional. The Vertex AI model_id used for the generative model. If not - # set, the default Assistant model will be used. - class GenerationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response for the - # {::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist AssistantService.StreamAssist} - # method. - # @!attribute [rw] answer - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer] - # Assist answer resource object containing parts of the assistant's final - # answer for the user's query. - # - # Not present if the current response doesn't add anything to previously - # sent - # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#replies AssistAnswer.replies}. - # - # Observe - # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#state AssistAnswer.state} to - # see if more parts are to be expected. While the state is `IN_PROGRESS`, the - # {::Google::Cloud::DiscoveryEngine::V1::AssistAnswer#replies AssistAnswer.replies} - # field in each response will contain replies (reply fragments) to be - # appended to the ones received in previous responses. [AssistAnswer.name][] - # won't be filled. - # - # If the state is `SUCCEEDED`, `FAILED` or `SKIPPED`, the response - # is the last response and [AssistAnswer.name][] will have a value. - # @!attribute [rw] session_info - # @return [::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse::SessionInfo] - # Session information. - # @!attribute [rw] assist_token - # @return [::String] - # A global unique ID that identifies the current pair of request and stream - # of responses. Used for feedback and support. - class StreamAssistResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about the session. - # @!attribute [rw] session - # @return [::String] - # Name of the newly generated or continued session. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}`. - class SessionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb deleted file mode 100644 index cdccc43c7688..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Chunk captures all raw metadata information of items to be recommended or - # searched in the chunk mode. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the chunk. - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. - # - # This field must be a UTF-8 encoded string with a length limit of 1024 - # characters. - # @!attribute [rw] id - # @return [::String] - # Unique chunk ID of the current chunk. - # @!attribute [rw] content - # @return [::String] - # Content is a string from a document (parsed content). - # @!attribute [r] relevance_score - # @return [::Float] - # Output only. Represents the relevance score based on similarity. - # Higher score indicates higher chunk relevance. - # The score is in range [-1.0, 1.0]. - # Only populated on - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse SearchResponse}. - # @!attribute [rw] document_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::DocumentMetadata] - # Metadata of the document from the current chunk. - # @!attribute [r] derived_struct_data - # @return [::Google::Protobuf::Struct] - # Output only. This field is OUTPUT_ONLY. - # It contains derived data that are not in the original input document. - # @!attribute [rw] page_span - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::PageSpan] - # Page span of the chunk. - # @!attribute [r] chunk_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::ChunkMetadata] - # Output only. Metadata of the current chunk. - # @!attribute [r] data_urls - # @return [::Array<::String>] - # Output only. Image Data URLs if the current chunk contains images. - # Data URLs are composed of four parts: a prefix (data:), a MIME type - # indicating the type of data, an optional base64 token if non-textual, - # and the data itself: - # data:[][;base64], - # @!attribute [r] annotation_contents - # @return [::Array<::String>] - # Output only. Annotation contents if the current chunk contains annotations. - # @!attribute [r] annotation_metadata - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk::AnnotationMetadata>] - # Output only. The annotation metadata includes structured content in the - # current chunk. - class Chunk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document metadata contains the information of the document of the current - # chunk. - # @!attribute [rw] uri - # @return [::String] - # Uri of the document. - # @!attribute [rw] title - # @return [::String] - # Title of the document. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # Data representation. - # The structured JSON data for the document. It should conform to the - # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an - # `INVALID_ARGUMENT` error is thrown. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Page span of the chunk. - # @!attribute [rw] page_start - # @return [::Integer] - # The start page of the chunk. - # @!attribute [rw] page_end - # @return [::Integer] - # The end page of the chunk. - class PageSpan - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of the current chunk. This field is only populated on - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # API. - # @!attribute [rw] previous_chunks - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk>] - # The previous chunks of the current chunk. The number is controlled by - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec#num_previous_chunks SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks}. - # This field is only populated on - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # API. - # @!attribute [rw] next_chunks - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Chunk>] - # The next chunks of the current chunk. The number is controlled by - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec#num_next_chunks SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks}. - # This field is only populated on - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # API. - class ChunkMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The structured content information. - # @!attribute [r] structure_type - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::StructureType] - # Output only. The structure type of the structured content. - # @!attribute [r] content - # @return [::String] - # Output only. The content of the structured content. - class StructuredContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The annotation metadata includes structured content in the current chunk. - # @!attribute [r] structured_content - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk::StructuredContent] - # Output only. The structured content information. - # @!attribute [r] image_id - # @return [::String] - # Output only. Image id is provided if the structured content is based on - # an image. - class AnnotationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the types of the structured content that can be extracted. - module StructureType - # Default value. - STRUCTURE_TYPE_UNSPECIFIED = 0 - - # Shareholder structure. - SHAREHOLDER_STRUCTURE = 1 - - # Signature structure. - SIGNATURE_STRUCTURE = 2 - - # Checkbox structure. - CHECKBOX_STRUCTURE = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb deleted file mode 100644 index c54fc7670ebd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb +++ /dev/null @@ -1,222 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for UpdateCmekConfig method. - # rpc. - # @!attribute [rw] config - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # Required. The CmekConfig resource. - # @!attribute [rw] set_default - # @return [::Boolean] - # Set the following CmekConfig as the default to be used for child - # resources if one is not specified. - class UpdateCmekConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetCmekConfigRequest method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, such as - # `projects/*/locations/*/cmekConfig` or - # `projects/*/locations/*/cmekConfigs/*`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - class GetCmekConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for single-regional CMEKs. - # @!attribute [rw] kms_key - # @return [::String] - # Required. Single-regional kms key resource name which will be used to - # encrypt resources - # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. - class SingleRegionKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configurations used to enable CMEK data encryption with Cloud KMS keys. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CmekConfig of the form - # `projects/{project}/locations/{location}/cmekConfig` or - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. - # @!attribute [rw] kms_key - # @return [::String] - # KMS key resource name which will be used to encrypt resources - # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{keyId}`. - # @!attribute [rw] kms_key_version - # @return [::String] - # KMS key version resource name which will be used to encrypt resources - # `/cryptoKeyVersions/{keyVersion}`. - # @!attribute [r] state - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig::State] - # Output only. The states of the CmekConfig. - # @!attribute [r] is_default - # @return [::Boolean] - # Output only. The default CmekConfig for the Customer. - # @!attribute [r] last_rotation_timestamp_micros - # @return [::Integer] - # Output only. The timestamp of the last key rotation. - # @!attribute [rw] single_region_keys - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SingleRegionKey>] - # Optional. Single-regional CMEKs that are required for some VAIS features. - # @!attribute [r] notebooklm_state - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig::NotebookLMState] - # Output only. Whether the NotebookLM Corpus is ready to be used. - class CmekConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # States of the CmekConfig. - module State - # The CmekConfig state is unknown. - STATE_UNSPECIFIED = 0 - - # The CmekConfig is creating. - CREATING = 1 - - # The CmekConfig can be used with DataStores. - ACTIVE = 2 - - # The CmekConfig is unavailable, most likely due to the KMS Key being - # revoked. - KEY_ISSUE = 3 - - # The CmekConfig is deleting. - DELETING = 4 - - # The CmekConfig deletion process failed. - DELETE_FAILED = 7 - - # The CmekConfig is not usable, most likely due to some internal issue. - UNUSABLE = 5 - - # The KMS key version is being rotated. - ACTIVE_ROTATING = 6 - - # The KMS key is soft deleted. Some cleanup policy will eventually be - # applied. - DELETED = 8 - end - - # States of NotebookLM. - module NotebookLMState - # The NotebookLM state is unknown. - NOTEBOOK_LM_STATE_UNSPECIFIED = 0 - - # The NotebookLM is not ready. - NOTEBOOK_LM_NOT_READY = 1 - - # The NotebookLM is ready to be used. - NOTEBOOK_LM_READY = 2 - - # The NotebookLM is not enabled. - NOTEBOOK_LM_NOT_ENABLED = 3 - end - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config CmekConfigService.UpdateCmekConfig} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class UpdateCmekConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs CmekConfigService.ListCmekConfigs} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location resource name, such as - # `projects/{project}/locations/{location}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this - # location, regardless of whether or not a CmekConfig exists, a - # PERMISSION_DENIED error is returned. - class ListCmekConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs CmekConfigService.ListCmekConfigs} - # method. - # @!attribute [rw] cmek_configs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CmekConfig>] - # All the customer's - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s. - class ListCmekConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config CmekConfigService.DeleteCmekConfig} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig} to delete, such as - # `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`. - class DeleteCmekConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config CmekConfigService.DeleteCmekConfig} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteCmekConfigMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb deleted file mode 100644 index 24f6a2d4d871..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/common.rb +++ /dev/null @@ -1,284 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # A floating point interval. - # @!attribute [rw] minimum - # @return [::Float] - # Inclusive lower bound. - # - # Note: The following fields are mutually exclusive: `minimum`, `exclusive_minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclusive_minimum - # @return [::Float] - # Exclusive lower bound. - # - # Note: The following fields are mutually exclusive: `exclusive_minimum`, `minimum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] maximum - # @return [::Float] - # Inclusive upper bound. - # - # Note: The following fields are mutually exclusive: `maximum`, `exclusive_maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] exclusive_maximum - # @return [::Float] - # Exclusive upper bound. - # - # Note: The following fields are mutually exclusive: `exclusive_maximum`, `maximum`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Interval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A custom attribute that is not explicitly modeled in a resource, e.g. - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent}. - # @!attribute [rw] text - # @return [::Array<::String>] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#text CustomAttribute.text} - # or - # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#numbers CustomAttribute.numbers} - # should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @!attribute [rw] numbers - # @return [::Array<::Float>] - # The numerical values of this custom attribute. For example, `[2.3, 15.4]` - # when the key is "lengths_cm". - # - # Exactly one of - # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#text CustomAttribute.text} - # or - # {::Google::Cloud::DiscoveryEngine::V1::CustomAttribute#numbers CustomAttribute.numbers} - # should be set. Otherwise, an `INVALID_ARGUMENT` error is returned. - class CustomAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information of an end user. - # @!attribute [rw] user_id - # @return [::String] - # 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. - # @!attribute [rw] user_agent - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent} - # or if - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#direct_user_request UserEvent.direct_user_request} - # is set. - # @!attribute [rw] time_zone - # @return [::String] - # Optional. IANA time zone, e.g. Europe/Budapest. - class UserInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Double list. - # @!attribute [rw] values - # @return [::Array<::Float>] - # Double values. - class DoubleList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Principal identifier of a user or a group. - # @!attribute [rw] user_id - # @return [::String] - # User identifier. - # For Google Workspace user account, user_id should be the google workspace - # user email. - # For non-google identity provider user account, user_id is the mapped user - # identifier configured during the workforcepool config. - # - # Note: The following fields are mutually exclusive: `user_id`, `group_id`, `external_entity_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] group_id - # @return [::String] - # Group identifier. - # For Google Workspace user account, group_id should be the google - # workspace group email. - # For non-google identity provider user account, group_id is the mapped - # group identifier configured during the workforcepool config. - # - # Note: The following fields are mutually exclusive: `group_id`, `user_id`, `external_entity_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] external_entity_id - # @return [::String] - # For 3P application identities which are not present in the customer - # identity provider. - # - # Note: The following fields are mutually exclusive: `external_entity_id`, `user_id`, `group_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Principal - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config to data store for `HEALTHCARE_FHIR` vertical. - # @!attribute [rw] enable_configurable_schema - # @return [::Boolean] - # Whether to enable configurable schema for `HEALTHCARE_FHIR` vertical. - # - # If set to `true`, the predefined healthcare fhir schema can be extended - # for more customized searching and filtering. - # @!attribute [rw] enable_static_indexing_for_batch_ingestion - # @return [::Boolean] - # Whether to enable static indexing for `HEALTHCARE_FHIR` batch - # ingestion. - # - # If set to `true`, the batch ingestion will be processed in a static - # indexing mode which is slower but more capable of handling larger - # volume. - class HealthcareFhirConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Promotion proto includes uri and other helping information to display the - # promotion. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the promotion. - # Maximum length: 160 characters. - # @!attribute [rw] uri - # @return [::String] - # Optional. The URL for the page the user wants to promote. Must be set for - # site search. For other verticals, this is optional. - # @!attribute [rw] document - # @return [::String] - # Optional. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} the user - # wants to promote. For site search, leave unset and only populate uri. Can - # be set along with uri. - # @!attribute [rw] image_uri - # @return [::String] - # Optional. The promotion thumbnail image url. - # @!attribute [rw] description - # @return [::String] - # Optional. The Promotion description. - # Maximum length: 200 characters. - # @!attribute [rw] enabled - # @return [::Boolean] - # Optional. The enabled promotion will be returned for any serving configs - # associated with the parent of the control this promotion is attached to. - # - # This flag is used for basic site search only. - class SearchLinkPromotion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The industry vertical associated with the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - module IndustryVertical - # Value used when unset. - INDUSTRY_VERTICAL_UNSPECIFIED = 0 - - # The generic vertical for documents that are not specific to any industry - # vertical. - GENERIC = 1 - - # The media industry vertical. - MEDIA = 2 - - # The healthcare FHIR vertical. - HEALTHCARE_FHIR = 7 - end - - # The type of solution. - module 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 - - # Used for use cases related to the Generative Chat agent. - # It's used for Generative chat engine only, the associated data stores - # must enrolled with `SOLUTION_TYPE_CHAT` solution. - SOLUTION_TYPE_GENERATIVE_CHAT = 4 - end - - # Defines a further subdivision of `SolutionType`. - # Specifically applies to - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - module SearchUseCase - # Value used when unset. Will not occur in CSS. - SEARCH_USE_CASE_UNSPECIFIED = 0 - - # Search use case. Expects the traffic has a non-empty - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query query}. - SEARCH_USE_CASE_SEARCH = 1 - - # Browse use case. Expects the traffic has an empty - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query query}. - SEARCH_USE_CASE_BROWSE = 2 - end - - # Tiers of search features. Different tiers might have different - # pricing. To learn more, check the pricing documentation. - module SearchTier - # Default value when the enum is unspecified. This is invalid to use. - SEARCH_TIER_UNSPECIFIED = 0 - - # Standard tier. - SEARCH_TIER_STANDARD = 1 - - # Enterprise tier. - SEARCH_TIER_ENTERPRISE = 2 - end - - # Add-on that provides additional functionality for search. - module SearchAddOn - # Default value when the enum is unspecified. This is invalid to use. - SEARCH_ADD_ON_UNSPECIFIED = 0 - - # Large language model add-on. - SEARCH_ADD_ON_LLM = 1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb deleted file mode 100644 index debb90a986d6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Suggestion deny list entry identifying the phrase to block from suggestions - # and the applied operation for the phrase. - # @!attribute [rw] block_phrase - # @return [::String] - # Required. Phrase to block from suggestions served. Can be maximum 125 - # characters. - # @!attribute [rw] match_operator - # @return [::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry::MatchOperator] - # Required. The match operator to apply for this phrase. Whether to block the - # exact phrase, or block any suggestions containing this phrase. - class SuggestionDenyListEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Operator for matching with the generated suggestions. - module MatchOperator - # Default value. Should not be used - MATCH_OPERATOR_UNSPECIFIED = 0 - - # If the suggestion is an exact match to the block_phrase, then block it. - EXACT_MATCH = 1 - - # If the suggestion contains the block_phrase, then block it. - CONTAINS = 2 - end - end - - # Autocomplete suggestions that are imported from Customer. - # @!attribute [rw] global_score - # @return [::Float] - # Global score of this suggestion. Control how this suggestion would be - # scored / ranked. - # - # Note: The following fields are mutually exclusive: `global_score`, `frequency`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] frequency - # @return [::Integer] - # Frequency of this suggestion. Will be used to rank suggestions when score - # is not available. - # - # Note: The following fields are mutually exclusive: `frequency`, `global_score`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggestion - # @return [::String] - # Required. The suggestion text. - # @!attribute [rw] language_code - # @return [::String] - # BCP-47 language code of this suggestion. - # @!attribute [rw] group_id - # @return [::String] - # If two suggestions have the same groupId, they will not be - # returned together. Instead the one ranked higher will be returned. This can - # be used to deduplicate semantically identical suggestions. - # @!attribute [rw] group_score - # @return [::Float] - # The score of this suggestion within its group. - # @!attribute [rw] alternative_phrases - # @return [::Array<::String>] - # Alternative matching phrases for this suggestion. - class CompletionSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb deleted file mode 100644 index 6dc5b172bd5d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query CompletionService.CompleteQuery} - # method. - # @!attribute [rw] data_store - # @return [::String] - # 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`. - # @!attribute [rw] query - # @return [::String] - # Required. The typeahead input used to fetch suggestions. Maximum length is - # 128 characters. - # @!attribute [rw] query_model - # @return [::String] - # Specifies the autocomplete data model. This overrides any model specified - # in the Configuration > Autocomplete section of the Cloud console. Currently - # supported values: - # - # * `document` - Using suggestions generated from user-imported documents. - # * `search-history` - Using suggestions generated from the past history of - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#user_pseudo_id 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. - # @!attribute [rw] include_tail_suggestions - # @return [::Boolean] - # 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. - class CompleteQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query CompletionService.CompleteQuery} - # method. - # @!attribute [rw] query_suggestions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion>] - # Results of the matched query suggestions. The result list is ordered and - # the first result is a top suggestion. - # @!attribute [rw] tail_match_triggered - # @return [::Boolean] - # 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. - class CompleteQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Suggestions as search queries. - # @!attribute [rw] suggestion - # @return [::String] - # The suggestion for the query. - # @!attribute [rw] completable_field_paths - # @return [::Array<::String>] - # 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. - class QuerySuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb deleted file mode 100644 index 0e7da491c6ae..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control.rb +++ /dev/null @@ -1,339 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Defines circumstances to be checked before allowing a behavior - # @!attribute [rw] query_terms - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition::QueryTerm>] - # Search only - # A list of terms to match the query on. - # Cannot be set when - # {::Google::Cloud::DiscoveryEngine::V1::Condition#query_regex Condition.query_regex} - # is set. - # - # Maximum of 10 query terms. - # @!attribute [rw] active_time_range - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition::TimeRange>] - # Range of time(s) specifying when condition is active. - # - # Maximum of 10 time ranges. - # @!attribute [rw] query_regex - # @return [::String] - # Optional. Query regex to match the whole search query. - # Cannot be set when - # {::Google::Cloud::DiscoveryEngine::V1::Condition#query_terms Condition.query_terms} - # is set. Only supported for Basic Site Search promotion serving controls. - class Condition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Matcher for search request query - # @!attribute [rw] value - # @return [::String] - # The specific query value to match against - # - # Must be lowercase, must be UTF-8. - # Can have at most 3 space separated terms if full_match is true. - # Cannot be an empty string. - # Maximum length of 5000 characters. - # @!attribute [rw] full_match - # @return [::Boolean] - # Whether the search query needs to exactly match the query term. - class QueryTerm - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used for time-dependent conditions. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start of time range. - # - # Range is inclusive. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of time range. - # - # Range is inclusive. - # Must be in the future. - class TimeRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines a conditioned behavior to employ during serving. - # Must be attached to a - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to be - # considered at serving time. Permitted actions dependent on `SolutionType`. - # @!attribute [rw] boost_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction] - # Defines a boost-type control - # - # Note: The following fields are mutually exclusive: `boost_action`, `filter_action`, `redirect_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] filter_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::FilterAction] - # Defines a filter-type control - # Currently not supported by Recommendation - # - # Note: The following fields are mutually exclusive: `filter_action`, `boost_action`, `redirect_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] redirect_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::RedirectAction] - # Defines a redirect-type control. - # - # Note: The following fields are mutually exclusive: `redirect_action`, `boost_action`, `filter_action`, `synonyms_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] synonyms_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::SynonymsAction] - # Treats a group of terms as synonyms of one another. - # - # Note: The following fields are mutually exclusive: `synonyms_action`, `boost_action`, `filter_action`, `redirect_action`, `promote_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] promote_action - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::PromoteAction] - # Promote certain links based on predefined trigger queries. - # - # Note: The following fields are mutually exclusive: `promote_action`, `boost_action`, `filter_action`, `redirect_action`, `synonyms_action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/*/locations/global/dataStore/*/controls/*` - # @!attribute [rw] display_name - # @return [::String] - # Required. Human readable name. The identifier used in UI views. - # - # Must be UTF-8 encoded string. Length limit is 128 characters. - # Otherwise an INVALID ARGUMENT error is thrown. - # @!attribute [r] associated_serving_config_ids - # @return [::Array<::String>] - # Output only. List of all - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} IDs this - # control is attached to. May take up to 10 minutes to update after changes. - # @!attribute [rw] solution_type - # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] - # Required. Immutable. What solution the control belongs to. - # - # Must be compatible with vertical of resource. - # Otherwise an INVALID ARGUMENT error is thrown. - # @!attribute [rw] use_cases - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchUseCase>] - # Specifies the use case for the control. - # Affects what condition fields can be set. - # Only applies to - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # Currently only allow one use case per control. - # Must be set when solution_type is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SolutionType.SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] conditions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Condition>] - # Determines when the associated action will trigger. - # - # Omit to always apply the action. - # Currently only a single condition may be specified. - # Otherwise an INVALID ARGUMENT error is thrown. - class Control - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Adjusts order of products in returned list. - # @!attribute [rw] fixed_boost - # @return [::Float] - # Optional. Strength of the boost, which should be in [-1, 1]. Negative - # boost means demotion. Default is 0.0 (No-op). - # - # Note: The following fields are mutually exclusive: `fixed_boost`, `interpolation_boost_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] interpolation_boost_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec] - # Optional. Complex specification for custom ranking based on customer - # defined attribute value. - # - # Note: The following fields are mutually exclusive: `interpolation_boost_spec`, `fixed_boost`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] boost - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Float] - # Strength of the boost, which should be in [-1, 1]. Negative - # boost means demotion. Default is 0.0 (No-op). - # @!attribute [rw] filter - # @return [::String] - # Required. Specifies which products to apply the boost to. - # - # If no filter is provided all products will be boosted (No-op). - # Syntax documentation: - # https://cloud.google.com/retail/docs/filter-and-order - # Maximum length is 5000 characters. - # Otherwise an INVALID ARGUMENT error is thrown. - # @!attribute [rw] data_store - # @return [::String] - # Required. Specifies which data store's documents can be boosted by this - # control. Full data store name e.g. - # projects/123/locations/global/collections/default_collection/dataStores/default_data_store - class BoostAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specification for custom ranking based on customer specified attribute - # value. It provides more controls for customized ranking than the simple - # (condition, boost) combination above. - # @!attribute [rw] field_name - # @return [::String] - # Optional. The name of the field whose value will be used to determine - # the boost amount. - # @!attribute [rw] attribute_type - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::AttributeType] - # Optional. The attribute type to be used to determine the boost amount. - # The attribute value can be derived from the field value of the - # specified field_name. In the case of numerical it is straightforward - # i.e. attribute_value = numerical_field_value. In the case of freshness - # however, attribute_value = (time.now() - datetime_field_value). - # @!attribute [rw] interpolation_type - # @return [::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::InterpolationType] - # Optional. The interpolation type to be applied to connect the control - # points listed below. - # @!attribute [rw] control_points - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Control::BoostAction::InterpolationBoostSpec::ControlPoint>] - # Optional. The control points used to define the curve. The monotonic - # function (defined through the interpolation_type above) passes through - # the control points listed here. - class InterpolationBoostSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The control points used to define the curve. The curve defined - # through these control points can only be monotonically increasing - # or decreasing(constant values are acceptable). - # @!attribute [rw] attribute_value - # @return [::String] - # Optional. Can be one of: - # 1. The numerical field value. - # 2. The duration spec for freshness: - # The value must be formatted as an XSD `dayTimeDuration` value (a - # restricted subset of an ISO 8601 duration value). The pattern for - # this is: `[nD][T[nH][nM][nS]]`. - # @!attribute [rw] boost_amount - # @return [::Float] - # Optional. The value between -1 to 1 by which to boost the score if - # the attribute_value evaluates to the value specified above. - class ControlPoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The attribute(or function) for which the custom ranking is to be - # applied. - module AttributeType - # Unspecified AttributeType. - ATTRIBUTE_TYPE_UNSPECIFIED = 0 - - # The value of the numerical field will be used to dynamically update - # the boost amount. In this case, the attribute_value (the x value) - # of the control point will be the actual value of the numerical - # field for which the boost_amount is specified. - NUMERICAL = 1 - - # For the freshness use case the attribute value will be the duration - # between the current time and the date in the datetime field - # specified. The value must be formatted as an XSD `dayTimeDuration` - # value (a restricted subset of an ISO 8601 duration value). The - # pattern for this is: `[nD][T[nH][nM][nS]]`. - # For example, `5D`, `3DT12H30M`, `T24H`. - FRESHNESS = 2 - end - - # The interpolation type to be applied. Default will be linear - # (Piecewise Linear). - module InterpolationType - # Interpolation type is unspecified. In this case, it defaults to - # Linear. - INTERPOLATION_TYPE_UNSPECIFIED = 0 - - # Piecewise linear interpolation will be applied. - LINEAR = 1 - end - end - end - - # Specified which products may be included in results. - # Uses same filter as boost. - # @!attribute [rw] filter - # @return [::String] - # Required. A filter to apply on the matching condition results. - # - # Required - # Syntax documentation: - # https://cloud.google.com/retail/docs/filter-and-order - # Maximum length is 5000 characters. Otherwise an INVALID - # ARGUMENT error is thrown. - # @!attribute [rw] data_store - # @return [::String] - # Required. Specifies which data store's documents can be filtered by this - # control. Full data store name e.g. - # projects/123/locations/global/collections/default_collection/dataStores/default_data_store - class FilterAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Redirects a shopper to the provided URI. - # @!attribute [rw] redirect_uri - # @return [::String] - # Required. The URI to which the shopper will be redirected. - # - # Required. - # URI must have length equal or less than 2000 characters. - # Otherwise an INVALID ARGUMENT error is thrown. - class RedirectAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Creates a set of terms that will act as synonyms of one another. - # - # Example: "happy" will also be considered as "glad", "glad" will also be - # considered as "happy". - # @!attribute [rw] synonyms - # @return [::Array<::String>] - # Defines a set of synonyms. - # Can specify up to 100 synonyms. - # Must specify at least 2 synonyms. Otherwise an INVALID ARGUMENT error is - # thrown. - class SynonymsAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Promote certain links based on some trigger queries. - # - # Example: Promote shoe store link when searching for `shoe` keyword. - # The link can be outside of associated data store. - # @!attribute [rw] data_store - # @return [::String] - # Required. Data store with which this promotion is attached to. - # @!attribute [rw] search_link_promotion - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion] - # Required. Promotion attached to this action. - class PromoteAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb deleted file mode 100644 index bc3ab8d77328..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request for CreateControl method. - # @!attribute [rw] parent - # @return [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @!attribute [rw] control - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # Required. The Control to create. - # @!attribute [rw] control_id - # @return [::String] - # Required. The ID to use for the Control, which will become the final - # component of the Control's resource name. - # - # This value must be within 1-63 characters. - # Valid characters are /[a-z][0-9]-_/. - class CreateControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateControl method. - # @!attribute [rw] control - # @return [::Google::Cloud::DiscoveryEngine::V1::Control] - # Required. The Control to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Control Control} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Control#name Control.name} - # * {::Google::Cloud::DiscoveryEngine::V1::Control#solution_type Control.solution_type} - # - # If not set or empty, all supported fields are updated. - class UpdateControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for DeleteControl method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Control to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - class DeleteControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetControl method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Control to get. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}` - class GetControlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListControls method. - # @!attribute [rw] parent - # @return [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}` - # or - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListControls` call. - # Provide this to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter to apply on the list results. Supported features: - # - # * List all the products under the parent branch if - # {::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest#filter filter} is - # unset. Currently this field is unsupported. - class ListControlsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListControls method. - # @!attribute [rw] controls - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Control>] - # All the Controls for a given data store. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListControlsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb deleted file mode 100644 index e52d1b12debf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +++ /dev/null @@ -1,119 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # External conversation proto definition. - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/{project}/locations/global/collections/{collection}/dataStore/*/conversations/*` - # or - # `projects/{project}/locations/global/collections/{collection}/engines/*/conversations/*`. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation::State] - # The state of the Conversation. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # A unique identifier for tracking users. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::ConversationMessage>] - # Conversation messages. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the conversation started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the conversation finished. - class Conversation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of the state of the conversation. - module State - # Unknown. - STATE_UNSPECIFIED = 0 - - # Conversation is currently open. - IN_PROGRESS = 1 - - # Conversation has been completed. - COMPLETED = 2 - end - end - - # Defines a reply message to user. - # @!attribute [rw] summary - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary] - # Summary based on search results. - class Reply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines context of the conversation - # @!attribute [rw] context_documents - # @return [::Array<::String>] - # The current list of documents the user is seeing. - # It contains the document resource references. - # @!attribute [rw] active_document - # @return [::String] - # The current active document the user opened. - # It contains the document resource reference. - class ConversationContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines text input. - # @!attribute [rw] input - # @return [::String] - # Text input. - # @!attribute [rw] context - # @return [::Google::Cloud::DiscoveryEngine::V1::ConversationContext] - # Conversation context of the input. - class TextInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines a conversation message. - # @!attribute [rw] user_input - # @return [::Google::Cloud::DiscoveryEngine::V1::TextInput] - # User text input. - # - # Note: The following fields are mutually exclusive: `user_input`, `reply`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reply - # @return [::Google::Cloud::DiscoveryEngine::V1::Reply] - # Search reply. - # - # Note: The following fields are mutually exclusive: `reply`, `user_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Message creation timestamp. - class ConversationMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb deleted file mode 100644 index 2f8416fb5406..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +++ /dev/null @@ -1,982 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation ConversationalSearchService.ConverseConversation} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`. - # Use - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-` - # to activate auto session mode, which automatically creates a new - # conversation inside a ConverseConversation session. - # @!attribute [rw] query - # @return [::Google::Cloud::DiscoveryEngine::V1::TextInput] - # Required. Current user input. - # @!attribute [rw] serving_config - # @return [::String] - # The resource name of the Serving Config to use. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}` - # If this is not set, the default serving config will be used. - # @!attribute [rw] conversation - # @return [::Google::Cloud::DiscoveryEngine::V1::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. - # @!attribute [rw] safe_search - # @return [::Boolean] - # Whether to turn on safe search. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - # @!attribute [rw] summary_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec] - # A specification for configuring the summary returned in the response. - # @!attribute [rw] filter - # @return [::String] - # 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. This will be used to filter search results - # which may affect the summary response. - # - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] - # Boost specification to boost certain documents in search results which may - # affect the converse response. For more information on boosting, see - # [Boosting](https://cloud.google.com/retail/docs/boosting#boost) - class ConverseConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation ConversationalSearchService.ConverseConversation} - # method. - # @!attribute [rw] reply - # @return [::Google::Cloud::DiscoveryEngine::V1::Reply] - # Answer to the current query. - # @!attribute [rw] conversation - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # Updated conversation including the answer. - # @!attribute [rw] search_results - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # Search Results. - class ConverseConversationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for CreateConversation method. - # @!attribute [rw] parent - # @return [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @!attribute [rw] conversation - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # Required. The conversation to create. - class CreateConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateConversation method. - # @!attribute [rw] conversation - # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] - # Required. The Conversation to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Conversation Conversation} to update. The - # following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Conversation#name Conversation.name} - # - # If not set or empty, all supported fields are updated. - class UpdateConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for DeleteConversation method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Conversation to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - class DeleteConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetConversation method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Conversation to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}` - class GetConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListConversations method. - # @!attribute [rw] parent - # @return [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListConversations` call. - # Provide this to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # A filter to apply on the list results. The supported features are: - # user_pseudo_id, state. - # - # Example: - # "user_pseudo_id = some_id" - # @!attribute [rw] order_by - # @return [::String] - # 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" - class ListConversationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListConversations method. - # @!attribute [rw] conversations - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Conversation>] - # All the Conversations for a given data store. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListConversationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery} - # method. - # @!attribute [rw] serving_config - # @return [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. - # This field is used to identify the serving configuration name, set - # of models used to make the search. - # @!attribute [rw] query - # @return [::Google::Cloud::DiscoveryEngine::V1::Query] - # Required. Current user query. - # @!attribute [rw] session - # @return [::String] - # The session resource name. Not required. - # - # When session field is not set, the API is in sessionless mode. - # - # We support auto session mode: users can use the wildcard symbol `-` as - # session ID. A new ID will be automatically generated and assigned. - # @!attribute [rw] safety_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec] - # Model specification. - # @!attribute [rw] related_questions_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec] - # Related questions specification. - # @!attribute [rw] grounding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec] - # Optional. Grounding specification. - # @!attribute [rw] answer_generation_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec] - # Answer generation specification. - # @!attribute [rw] search_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec] - # Search specification. - # @!attribute [rw] query_understanding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec] - # Query understanding specification. - # @!attribute [rw] asynchronous_mode - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Deprecated: This field is deprecated. Streaming Answer API will be - # supported. - # - # Asynchronous mode control. - # - # If enabled, the response will be returned with answer/session resource - # name without final answer. The API users need to do the polling to get - # the latest status of answer/session by calling - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} - # or - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} - # method. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # 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`. - # - # The field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - # @!attribute [rw] end_user_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec] - # Optional. End user specification. - class AnswerQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Safety specification. - # There are two use cases: - # 1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold - # will be applied for all categories. - # 2. when safety_spec.enable is set and some safety_settings are set, only - # specified safety_settings are applied. - # @!attribute [rw] enable - # @return [::Boolean] - # Enable the safety filtering on the answer response. It is false by - # default. - # @!attribute [rw] safety_settings - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting>] - # Optional. Safety settings. - # This settings are effective only when the safety_spec.enable is true. - class SafetySpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Safety settings. - # @!attribute [rw] category - # @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory] - # Required. Harm category. - # @!attribute [rw] threshold - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec::SafetySetting::HarmBlockThreshold] - # Required. The harm block threshold. - class SafetySetting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Probability based thresholds levels for blocking. - module HarmBlockThreshold - # Unspecified harm block threshold. - HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0 - - # Block low threshold and above (i.e. block more). - BLOCK_LOW_AND_ABOVE = 1 - - # Block medium threshold and above. - BLOCK_MEDIUM_AND_ABOVE = 2 - - # Block only high threshold (i.e. block less). - BLOCK_ONLY_HIGH = 3 - - # Block none. - BLOCK_NONE = 4 - - # Turn off the safety filter. - OFF = 5 - end - end - end - - # Related questions specification. - # @!attribute [rw] enable - # @return [::Boolean] - # Enable related questions feature if true. - class RelatedQuestionsSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Grounding specification. - # @!attribute [rw] include_grounding_supports - # @return [::Boolean] - # Optional. Specifies whether to include grounding_supports in the answer. - # The default value is `false`. - # - # When this field is set to `true`, returned answer will have - # `grounding_score` and will contain GroundingSupports for each claim. - # @!attribute [rw] filtering_level - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec::FilteringLevel] - # Optional. Specifies whether to enable the filtering based on grounding - # score and at what level. - class GroundingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Level to filter based on answer grounding. - module FilteringLevel - # Default is no filter - FILTERING_LEVEL_UNSPECIFIED = 0 - - # Filter answers based on a low threshold. - FILTERING_LEVEL_LOW = 1 - - # Filter answers based on a high threshold. - FILTERING_LEVEL_HIGH = 2 - end - end - - # Answer generation specification. - # @!attribute [rw] model_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec] - # Answer generation model specification. - # @!attribute [rw] prompt_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec] - # Answer generation prompt specification. - # @!attribute [rw] include_citations - # @return [::Boolean] - # Specifies whether to include citation metadata in the answer. The default - # value is `false`. - # @!attribute [rw] answer_language_code - # @return [::String] - # Language code for Answer. Use language tags defined by - # [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - # Note: This is an experimental feature. - # @!attribute [rw] ignore_adversarial_query - # @return [::Boolean] - # Specifies whether to filter out adversarial queries. The default value - # is `false`. - # - # Google employs search-query classification to detect adversarial - # queries. No answer 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 answers for adversarial queries and return - # fallback messages instead. - # @!attribute [rw] ignore_non_answer_seeking_query - # @return [::Boolean] - # Specifies whether to filter out queries that are not answer-seeking. - # The default value is `false`. - # - # Google employs search-query classification to detect answer-seeking - # queries. No answer is returned if the search query is classified as a - # non-answer seeking query. If this field is set to `true`, we skip - # generating answers for non-answer seeking queries and return - # fallback messages instead. - # @!attribute [rw] ignore_low_relevant_content - # @return [::Boolean] - # Specifies whether to filter out queries that have low relevance. - # - # If this field is set to `false`, all search results are used regardless - # of relevance to generate answers. If set to `true` or unset, the behavior - # will be determined automatically by the service. - # @!attribute [rw] ignore_jail_breaking_query - # @return [::Boolean] - # Optional. Specifies whether to filter out jail-breaking queries. The - # default value is `false`. - # - # Google employs search-query classification to detect jail-breaking - # queries. No summary is returned if the search query is classified as a - # jail-breaking query. A user might add instructions to the query to - # change the tone, style, language, content of the answer, or ask the - # model to act as a different entity, e.g. "Reply in the tone of a - # competing company's CEO". If this field is set to `true`, we skip - # generating summaries for jail-breaking queries and return fallback - # messages instead. - class AnswerGenerationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Answer Generation Model specification. - # @!attribute [rw] model_version - # @return [::String] - # Model version. If not set, it will use the default stable model. - # Allowed values are: stable, preview. - class ModelSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Answer generation prompt specification. - # @!attribute [rw] preamble - # @return [::String] - # Customized preamble. - class PromptSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Search specification. - # @!attribute [rw] search_params - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams] - # Search parameters. - # - # Note: The following fields are mutually exclusive: `search_params`, `search_result_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] search_result_list - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList] - # Search result list. - # - # Note: The following fields are mutually exclusive: `search_result_list`, `search_params`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SearchSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Search parameters. - # @!attribute [rw] max_return_results - # @return [::Integer] - # Number of search results to return. - # The default value is 10. - # @!attribute [rw] filter - # @return [::String] - # 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. This will be used to filter - # search results which may affect the Answer response. - # - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key - # to a key property defined in the Vertex AI Search backend -- this - # mapping is defined by the customer in their schema. For example a - # media customers might have a field 'name' in their schema. In this - # case the filter would look like this: filter --> name:'ANY("king - # kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] - # Boost specification to boost certain documents in search results which - # may affect the answer query response. For more information on boosting, - # see [Boosting](https://cloud.google.com/retail/docs/boosting#boost) - # @!attribute [rw] order_by - # @return [::String] - # The order in which documents are returned. Documents can be ordered - # by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} - # object. Leave it unset if ordered by relevance. `order_by` expression - # is case-sensitive. For more information on ordering, see - # [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) - # - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @!attribute [rw] search_result_mode - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode] - # Specifies the search result mode. If unspecified, the - # search result mode defaults to `DOCUMENTS`. - # See [parse and chunk - # documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents) - # @!attribute [rw] data_store_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] - # Specs defining dataStores to filter on in a search call and - # configurations for those dataStores. This is only considered for - # engines with multiple dataStores use case. For single dataStore within - # an engine, they should use the specs at the top level. - class SearchParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Search result list. - # @!attribute [rw] search_results - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>] - # Search results. - class SearchResultList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Search result. - # @!attribute [rw] unstructured_document_info - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo] - # Unstructured document information. - # - # Note: The following fields are mutually exclusive: `unstructured_document_info`, `chunk_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] chunk_info - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo] - # Chunk information. - # - # Note: The following fields are mutually exclusive: `chunk_info`, `unstructured_document_info`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Unstructured document information. - # @!attribute [rw] document - # @return [::String] - # Document resource name. - # @!attribute [rw] uri - # @return [::String] - # URI for the document. - # @!attribute [rw] title - # @return [::String] - # Title. - # @!attribute [rw] document_contexts - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>] - # List of document contexts. The content will be used for Answer - # Generation. This is supposed to be the main content of the document - # that can be long and comprehensive. - # @!attribute [rw] extractive_segments - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>] - # List of extractive segments. - # @!attribute [rw] extractive_answers - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>] - # Deprecated: This field is deprecated and will have no effect on - # the Answer generation. - # Please use document_contexts and extractive_segments fields. - # List of extractive answers. - class UnstructuredDocumentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document context. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] content - # @return [::String] - # Document content to be used for answer generation. - class DocumentContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Extractive segment. - # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) - # Answer generation will only use it if document_contexts is empty. - # This is supposed to be shorter snippets. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] content - # @return [::String] - # Extractive segment content. - class ExtractiveSegment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Extractive answer. - # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers) - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - # @!attribute [rw] content - # @return [::String] - # Extractive answer content. - class ExtractiveAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Chunk information. - # @!attribute [rw] chunk - # @return [::String] - # Chunk resource name. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. - # @!attribute [rw] document_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata] - # Metadata of the document from the current chunk. - class ChunkInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document metadata contains the information of the document of the - # current chunk. - # @!attribute [rw] uri - # @return [::String] - # Uri of the document. - # @!attribute [rw] title - # @return [::String] - # Title of the document. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - - # Query understanding specification. - # @!attribute [rw] query_classification_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec] - # Query classification specification. - # @!attribute [rw] query_rephraser_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec] - # Query rephraser specification. - # @!attribute [rw] disable_spell_correction - # @return [::Boolean] - # Optional. Whether to disable spell correction. - # The default value is `false`. - class QueryUnderstandingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query classification specification. - # @!attribute [rw] types - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>] - # Enabled query classification types. - class QueryClassificationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query classification types. - module Type - # Unspecified query classification type. - TYPE_UNSPECIFIED = 0 - - # Adversarial query classification type. - ADVERSARIAL_QUERY = 1 - - # Non-answer-seeking query classification type, for chit chat. - NON_ANSWER_SEEKING_QUERY = 2 - - # Jail-breaking query classification type. - JAIL_BREAKING_QUERY = 3 - - # Non-answer-seeking query classification type, for no clear intent. - NON_ANSWER_SEEKING_QUERY_V2 = 4 - - # User defined query classification type. - USER_DEFINED_CLASSIFICATION_QUERY = 5 - end - end - - # Query rephraser specification. - # @!attribute [rw] disable - # @return [::Boolean] - # Disable query rephraser. - # @!attribute [rw] max_rephrase_steps - # @return [::Integer] - # Max rephrase steps. - # The max number is 5 steps. - # If not set or set to < 1, it will be set to 1 by default. - # @!attribute [rw] model_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec] - # Optional. Query Rephraser Model specification. - class QueryRephraserSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query Rephraser Model specification. - # @!attribute [rw] model_type - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec::ModelSpec::ModelType] - # Optional. Enabled query rephraser model type. If not set, it will use - # LARGE by default. - class ModelSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Query rephraser types. Currently only supports single-hop - # (max_rephrase_steps = 1) model selections. For multi-hop - # (max_rephrase_steps > 1), there is only one default model. - module ModelType - # Unspecified model type. - MODEL_TYPE_UNSPECIFIED = 0 - - # Small query rephraser model. Gemini 1.0 XS model. - SMALL = 1 - - # Large query rephraser model. Gemini 1.0 Pro model. - LARGE = 2 - end - end - end - end - - # End user specification. - # @!attribute [rw] end_user_metadata - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData>] - # Optional. End user metadata. - class EndUserSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # End user metadata. - # @!attribute [rw] chunk_info - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo] - # Chunk information. - class EndUserMetaData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Chunk information. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. It is limited to 8000 characters. - # @!attribute [rw] document_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec::EndUserMetaData::ChunkInfo::DocumentMetadata] - # Metadata of the document from the current chunk. - class ChunkInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Document metadata contains the information of the document of - # the current chunk. - # @!attribute [rw] title - # @return [::String] - # Title of the document. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query ConversationalSearchService.AnswerQuery} - # method. - # @!attribute [rw] answer - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] - # Answer resource object. - # If - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec#max_rephrase_steps AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps} - # is greater than 1, use - # {::Google::Cloud::DiscoveryEngine::V1::Answer#name Answer.name} to fetch answer - # information using - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer} - # API. - # @!attribute [rw] session - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # Session resource object. - # It will be only available when session field is set and valid in the - # {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest AnswerQueryRequest} - # request. - # @!attribute [rw] answer_query_token - # @return [::String] - # A global unique ID used for logging. - class AnswerQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetAnswer method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Answer to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}` - class GetAnswerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for CreateSession method. - # @!attribute [rw] parent - # @return [::String] - # Required. Full resource name of parent data store. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @!attribute [rw] session - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # Required. The session to create. - class CreateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for UpdateSession method. - # @!attribute [rw] session - # @return [::Google::Cloud::DiscoveryEngine::V1::Session] - # Required. The Session to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following - # are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name} - # - # If not set or empty, all supported fields are updated. - class UpdateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for DeleteSession method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Session to delete. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - class DeleteSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for GetSession method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Session to get. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}` - # @!attribute [rw] include_answer_details - # @return [::Boolean] - # Optional. If set to true, the full session including all answer details - # will be returned. - class GetSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ListSessions method. - # @!attribute [rw] parent - # @return [::String] - # Required. The data store resource name. Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of results to return. If unspecified, defaults - # to 50. Max allowed value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListSessions` call. - # Provide this to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # A comma-separated list of fields to filter by, in EBNF grammar. - # The supported fields are: - # * `user_pseudo_id` - # * `state` - # * `display_name` - # * `starred` - # * `is_pinned` - # * `labels` - # * `create_time` - # * `update_time` - # - # Examples: - # "user_pseudo_id = some_id" - # "display_name = \"some_name\"" - # "starred = true" - # "is_pinned=true AND (NOT labels:hidden)" - # "create_time > \"1970-01-01T12:00:00Z\"" - # @!attribute [rw] order_by - # @return [::String] - # 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` - # * `session_name` - # * `is_pinned` - # - # Example: - # - # * "update_time desc" - # * "create_time" - # * "is_pinned desc,update_time desc": list sessions by is_pinned first, then - # by update_time. - class ListSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for ListSessions method. - # @!attribute [rw] sessions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Session>] - # All the Sessions for a given data store. - # @!attribute [rw] next_page_token - # @return [::String] - # Pagination token, if not returned indicates the last page. - class ListSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb deleted file mode 100644 index c8797885f8f2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/custom_tuning_model.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Metadata that describes a custom tuned model. - # @!attribute [rw] name - # @return [::String] - # Required. The fully qualified resource name of the model. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/customTuningModels/{custom_tuning_model}`. - # - # Model must be an alpha-numerical string with limit of 40 characters. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the model. - # @!attribute [rw] model_version - # @return [::Integer] - # The version of the model. - # @!attribute [rw] model_state - # @return [::Google::Cloud::DiscoveryEngine::V1::CustomTuningModel::ModelState] - # The state that the model is in (e.g.`TRAINING` or `TRAINING_FAILED`). - # @!attribute [rw] create_time - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Timestamp] - # Deprecated: Timestamp the Model was created at. - # @!attribute [rw] training_start_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp the model training was initiated. - # @!attribute [rw] metrics - # @return [::Google::Protobuf::Map{::String => ::Float}] - # The metrics of the trained model. - # @!attribute [rw] error_message - # @return [::String] - # Currently this is only populated if the model state is - # `INPUT_VALIDATION_FAILED`. - class CustomTuningModel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class MetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of the model. - module ModelState - # Default value. - MODEL_STATE_UNSPECIFIED = 0 - - # The model is in a paused training state. - TRAINING_PAUSED = 1 - - # The model is currently training. - TRAINING = 2 - - # The model has successfully completed training. - TRAINING_COMPLETE = 3 - - # The model is ready for serving. - READY_FOR_SERVING = 4 - - # The model training failed. - TRAINING_FAILED = 5 - - # The model training finished successfully but metrics did not improve. - NO_IMPROVEMENT = 6 - - # Input data validation failed. Model training didn't start. - INPUT_VALIDATION_FAILED = 7 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb deleted file mode 100644 index 23e60a59bb16..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +++ /dev/null @@ -1,288 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # DataStore captures global settings and configs at the DataStore level. - # @!attribute [rw] name - # @return [::String] - # Immutable. Identifier. The full resource name of the data store. - # Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # This field must be a UTF-8 encoded string with a length limit of 1024 - # characters. - # @!attribute [rw] display_name - # @return [::String] - # Required. The data store display name. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] industry_vertical - # @return [::Google::Cloud::DiscoveryEngine::V1::IndustryVertical] - # Immutable. The industry vertical that the data store registers. - # @!attribute [rw] solution_types - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SolutionType>] - # The solutions that the data store enrolls. Available solutions for each - # {::Google::Cloud::DiscoveryEngine::V1::DataStore#industry_vertical industry_vertical}: - # - # * `MEDIA`: `SOLUTION_TYPE_RECOMMENDATION` and `SOLUTION_TYPE_SEARCH`. - # * `SITE_SEARCH`: `SOLUTION_TYPE_SEARCH` is automatically enrolled. Other - # solutions cannot be enrolled. - # @!attribute [r] default_schema_id - # @return [::String] - # Output only. The id of the default - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} associated to this data - # store. - # @!attribute [rw] content_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig] - # Immutable. The content config of the data store. If this field is unset, - # the server behavior defaults to - # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::NO_CONTENT ContentConfig.NO_CONTENT}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} was created at. - # @!attribute [rw] advanced_site_search_config - # @return [::Google::Cloud::DiscoveryEngine::V1::AdvancedSiteSearchConfig] - # Optional. Configuration for advanced site search. - # @!attribute [rw] natural_language_query_understanding_config - # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig] - # Optional. Configuration for Natural Language Query Understanding. - # @!attribute [rw] kms_key_name - # @return [::String] - # Input only. The KMS key to be used to protect this DataStore at creation - # time. - # - # Must be set for requests that need to comply with CMEK Org Policy - # protections. - # - # If this field is set and processed successfully, the DataStore will be - # protected by the KMS key, as indicated in the cmek_config field. - # @!attribute [r] cmek_config - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # Output only. CMEK-related information for the DataStore. - # @!attribute [r] billing_estimation - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore::BillingEstimation] - # Output only. Data size estimation for billing. - # @!attribute [rw] acl_enabled - # @return [::Boolean] - # Immutable. Whether data in the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} has ACL information. - # If set to `true`, the source data must have ACL. ACL will be ingested when - # data is ingested by - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents DocumentService.ImportDocuments} - # methods. - # - # When ACL is enabled for the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} can't be accessed by - # calling - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} - # or - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments}. - # - # Currently ACL is only supported in `GENERIC` industry vertical with - # non-`PUBLIC_WEBSITE` content config. - # @!attribute [rw] workspace_config - # @return [::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig] - # Config to store data store type configuration for workspace data. This - # must be set when - # {::Google::Cloud::DiscoveryEngine::V1::DataStore#content_config DataStore.content_config} - # is set as - # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::GOOGLE_WORKSPACE DataStore.ContentConfig.GOOGLE_WORKSPACE}. - # @!attribute [rw] document_processing_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig] - # Configuration for Document understanding and enrichment. - # @!attribute [rw] starting_schema - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # The start schema to use for this - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} when provisioning - # it. If unset, a default vertical specialized schema will be used. - # - # This field is only used by - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store CreateDataStore} - # API, and will be ignored if used in other APIs. This field will be omitted - # from all API responses including - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store CreateDataStore} - # API. To retrieve a schema of a - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, use - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema SchemaService.GetSchema} - # API instead. - # - # The provided schema will be validated against certain rules on schema. - # Learn more from [this - # doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema). - # @!attribute [rw] healthcare_fhir_config - # @return [::Google::Cloud::DiscoveryEngine::V1::HealthcareFhirConfig] - # Optional. Configuration for `HEALTHCARE_FHIR` vertical. - # @!attribute [rw] identity_mapping_store - # @return [::String] - # Immutable. The fully qualified resource name of the associated - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore IdentityMappingStore}. - # This field can only be set for acl_enabled DataStores with `THIRD_PARTY` or - # `GSUITE` IdP. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}`. - class DataStore - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Estimation of data size per data store. - # @!attribute [rw] structured_data_size - # @return [::Integer] - # Data size for structured data in terms of bytes. - # @!attribute [rw] unstructured_data_size - # @return [::Integer] - # Data size for unstructured data in terms of bytes. - # @!attribute [rw] website_data_size - # @return [::Integer] - # Data size for websites in terms of bytes. - # @!attribute [rw] structured_data_update_time - # @return [::Google::Protobuf::Timestamp] - # Last updated timestamp for structured data. - # @!attribute [rw] unstructured_data_update_time - # @return [::Google::Protobuf::Timestamp] - # Last updated timestamp for unstructured data. - # @!attribute [rw] website_data_update_time - # @return [::Google::Protobuf::Timestamp] - # Last updated timestamp for websites. - class BillingEstimation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Content config of the data store. - module ContentConfig - # Default value. - CONTENT_CONFIG_UNSPECIFIED = 0 - - # Only contains documents without any - # {::Google::Cloud::DiscoveryEngine::V1::Document#content Document.content}. - NO_CONTENT = 1 - - # Only contains documents with - # {::Google::Cloud::DiscoveryEngine::V1::Document#content Document.content}. - CONTENT_REQUIRED = 2 - - # The data store is used for public website search. - PUBLIC_WEBSITE = 3 - - # The data store is used for workspace search. Details of workspace - # data store are specified in the - # {::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig WorkspaceConfig}. - GOOGLE_WORKSPACE = 4 - end - end - - # Configuration data for advance site search. - # @!attribute [rw] disable_initial_index - # @return [::Boolean] - # If set true, initial indexing is disabled for the DataStore. - # @!attribute [rw] disable_automatic_refresh - # @return [::Boolean] - # If set true, automatic refresh is disabled for the DataStore. - class AdvancedSiteSearchConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for Natural Language Query Understanding. - # @!attribute [rw] mode - # @return [::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode] - # Mode of Natural Language Query Understanding. If this field is unset, the - # behavior defaults to - # {::Google::Cloud::DiscoveryEngine::V1::NaturalLanguageQueryUnderstandingConfig::Mode::DISABLED NaturalLanguageQueryUnderstandingConfig.Mode.DISABLED}. - class NaturalLanguageQueryUnderstandingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Mode of Natural Language Query Understanding. When the - # NaturalLanguageQueryUnderstandingConfig.Mode is ENABLED, the natural - # language understanding capabilities will be enabled for a search request if - # the NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition in the - # SearchRequest is ENABLED. - module Mode - # Default value. - MODE_UNSPECIFIED = 0 - - # Natural Language Query Understanding is disabled. - DISABLED = 1 - - # Natural Language Query Understanding is enabled. - ENABLED = 2 - end - end - - # Config to store data store type configuration for workspace data - # @!attribute [rw] type - # @return [::Google::Cloud::DiscoveryEngine::V1::WorkspaceConfig::Type] - # The Google Workspace data source. - # @!attribute [rw] dasher_customer_id - # @return [::String] - # Obfuscated Dasher customer ID. - # @!attribute [rw] super_admin_service_account - # @return [::String] - # Optional. The super admin service account for the workspace that will be - # used for access token generation. For now we only use it for Native Google - # Drive connector data ingestion. - # @!attribute [rw] super_admin_email_address - # @return [::String] - # Optional. The super admin email address for the workspace that will be used - # for access token generation. For now we only use it for Native Google Drive - # connector data ingestion. - class WorkspaceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies the type of Workspace App supported by this DataStore - module Type - # Defaults to an unspecified Workspace type. - TYPE_UNSPECIFIED = 0 - - # Workspace Data Store contains Drive data - GOOGLE_DRIVE = 1 - - # Workspace Data Store contains Mail data - GOOGLE_MAIL = 2 - - # Workspace Data Store contains Sites data - GOOGLE_SITES = 3 - - # Workspace Data Store contains Calendar data - GOOGLE_CALENDAR = 4 - - # Workspace Data Store contains Chat data - GOOGLE_CHAT = 5 - - # Workspace Data Store contains Groups data - GOOGLE_GROUPS = 6 - - # Workspace Data Store contains Keep data - GOOGLE_KEEP = 7 - - # Workspace Data Store contains People data - GOOGLE_PEOPLE = 8 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb deleted file mode 100644 index 40ab5de7c17f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +++ /dev/null @@ -1,236 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store DataStoreService.CreateDataStore} - # method. - # @!attribute [rw] cmek_config_name - # @return [::String] - # Resource name of the CmekConfig to use for protecting this DataStore. - # - # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] disable_cmek - # @return [::Boolean] - # DataStore without CMEK protections. If a default CmekConfig is set for - # the project, setting this field will override the default CmekConfig as - # well. - # - # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @!attribute [rw] data_store - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # create. - # @!attribute [rw] data_store_id - # @return [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become - # the final component of the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}'s resource name. - # - # 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. - # @!attribute [rw] create_advanced_site_search - # @return [::Boolean] - # A boolean flag indicating whether user want to directly create an advanced - # data store for site search. - # If the data store is not configured as site - # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will - # be ignored. - # @!attribute [rw] skip_default_schema_creation - # @return [::Boolean] - # A boolean flag indicating whether to skip the default schema creation for - # the data store. Only enable this flag if you are certain that the default - # schema is incompatible with your use case. - # - # If set to true, you must manually create a schema for the data store before - # any documents can be ingested. - # - # This flag cannot be specified if `data_store.starting_schema` is specified. - class CreateDataStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store DataStoreService.GetDataStore} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} - # does not exist, a NOT_FOUND error is returned. - class GetDataStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store DataStoreService.CreateDataStore} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class CreateDataStoreMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s under this - # location, regardless of whether or not this data store exists, a - # PERMISSION_DENIED error is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s - # to return. If unspecified, defaults to 10. The maximum allowed value is 50. - # Values above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # must match the call that provided the page token. Otherwise, an - # INVALID_ARGUMENT error is returned. - # @!attribute [rw] filter - # @return [::String] - # Filter by solution type . - # For example: `filter = 'solution_type:SOLUTION_TYPE_SEARCH'` - class ListDataStoresRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores} - # method. - # @!attribute [rw] data_stores - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DataStore>] - # All the customer's {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest#page_token ListDataStoresRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListDataStoresResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store DataStoreService.DeleteDataStore} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete - # does not exist, a NOT_FOUND error is returned. - class DeleteDataStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store DataStoreService.UpdateDataStore} - # method. - # @!attribute [rw] data_store - # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to - # update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update - # does not exist, a NOT_FOUND error is returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - class UpdateDataStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store DataStoreService.DeleteDataStore} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteDataStoreMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb deleted file mode 100644 index 117c02911cc3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document.rb +++ /dev/null @@ -1,245 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Document captures all raw metadata information of items to be recommended or - # searched. - # @!attribute [rw] struct_data - # @return [::Google::Protobuf::Struct] - # The structured JSON data for the document. It should conform to the - # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an - # `INVALID_ARGUMENT` error is thrown. - # - # Note: The following fields are mutually exclusive: `struct_data`, `json_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] json_data - # @return [::String] - # The JSON string representation of the document. It should conform to the - # registered {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} or an - # `INVALID_ARGUMENT` error is thrown. - # - # Note: The following fields are mutually exclusive: `json_data`, `struct_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # 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. - # @!attribute [rw] id - # @return [::String] - # Immutable. The identifier of the document. - # - # Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) - # standard with a length limit of 128 characters. - # @!attribute [rw] schema_id - # @return [::String] - # The identifier of the schema located in the same data store. - # @!attribute [rw] content - # @return [::Google::Cloud::DiscoveryEngine::V1::Document::Content] - # The unstructured data linked to this document. Content can only be set - # and must be set if this document is under a `CONTENT_REQUIRED` data store. - # @!attribute [rw] parent_document_id - # @return [::String] - # 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. - # @!attribute [r] derived_struct_data - # @return [::Google::Protobuf::Struct] - # Output only. This field is OUTPUT_ONLY. - # It contains derived data that are not in the original input document. - # @!attribute [rw] acl_info - # @return [::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo] - # Access control information for the document. - # @!attribute [r] index_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the document was indexed. If this field is set, - # the document could be returned in search results. - # - # This field is OUTPUT_ONLY. If this field is not populated, it means the - # document has never been indexed. - # @!attribute [r] index_status - # @return [::Google::Cloud::DiscoveryEngine::V1::Document::IndexStatus] - # Output only. The index status of the document. - # - # * If document is indexed successfully, the index_time field is populated. - # * Otherwise, if document is not indexed due to errors, the error_samples - # field is populated. - # * Otherwise, if document's index is in progress, the pending_message field - # is populated. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Unstructured data linked to this document. - # @!attribute [rw] raw_bytes - # @return [::String] - # 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. - # - # Note: The following fields are mutually exclusive: `raw_bytes`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # The URI of the content. Only Cloud Storage URIs (e.g. - # `gs://bucket-name/path/to/file`) are supported. The maximum file size - # is 2.5 MB for text-based formats, 200 MB for other formats. - # - # Note: The following fields are mutually exclusive: `uri`, `raw_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mime_type - # @return [::String] - # The MIME type of the content. Supported types: - # - # * `application/pdf` (PDF, only native PDFs are supported for now) - # * `text/html` (HTML) - # * `text/plain` (TXT) - # * `application/xml` or `text/xml` (XML) - # * `application/json` (JSON) - # * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) - # * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) - # * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - # (XLSX) - # * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) - # - # The following types are supported only if layout parser is enabled in the - # data store: - # - # * `image/bmp` (BMP) - # * `image/gif` (GIF) - # * `image/jpeg` (JPEG) - # * `image/png` (PNG) - # * `image/tiff` (TIFF) - # - # See https://www.iana.org/assignments/media-types/media-types.xhtml. - class Content - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ACL Information of the Document. - # @!attribute [rw] readers - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo::AccessRestriction>] - # Readers of the document. - class AclInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # AclRestriction to model complex inheritance restrictions. - # - # Example: Modeling a "Both Permit" inheritance, where to access a - # child document, user needs to have access to parent document. - # - # Document Hierarchy - Space_S --> Page_P. - # - # Readers: - # Space_S: group_1, user_1 - # Page_P: group_2, group_3, user_2 - # - # Space_S ACL Restriction - - # { - # "acl_info": { - # "readers": [ - # { - # "principals": [ - # { - # "group_id": "group_1" - # }, - # { - # "user_id": "user_1" - # } - # ] - # } - # ] - # } - # } - # - # Page_P ACL Restriction. - # { - # "acl_info": { - # "readers": [ - # { - # "principals": [ - # { - # "group_id": "group_2" - # }, - # { - # "group_id": "group_3" - # }, - # { - # "user_id": "user_2" - # } - # ], - # }, - # { - # "principals": [ - # { - # "group_id": "group_1" - # }, - # { - # "user_id": "user_1" - # } - # ], - # } - # ] - # } - # } - # @!attribute [rw] principals - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Principal>] - # List of principals. - # @!attribute [rw] idp_wide - # @return [::Boolean] - # All users within the Identity Provider. - class AccessRestriction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Index status of the document. - # @!attribute [rw] index_time - # @return [::Google::Protobuf::Timestamp] - # The time when the document was indexed. - # If this field is populated, it means the document has been indexed. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while indexing the document. - # If this field is populated, the document is not indexed due to errors. - # @!attribute [rw] pending_message - # @return [::String] - # Immutable. The message indicates the document index is in progress. - # If this field is populated, the document index is pending. - class IndexStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb deleted file mode 100644 index 3009873d1c17..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +++ /dev/null @@ -1,176 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # A singleton resource of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. If it's empty when - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is created and - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is set to - # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED}, - # the default parser will default to digital parser. - # @!attribute [rw] name - # @return [::String] - # The full resource name of the Document Processing Config. - # Format: - # `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`. - # @!attribute [rw] chunking_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ChunkingConfig] - # Whether chunking mode is enabled. - # @!attribute [rw] default_parsing_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig] - # Configurations for default Document parser. - # If not specified, we will configure it as default DigitalParsingConfig, and - # the default parsing config will be applied to all file types for Document - # parsing. - # @!attribute [rw] parsing_config_overrides - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig}] - # Map from file type to override the default parsing configuration based on - # the file type. Supported keys: - # - # * `pdf`: Override parsing config for PDF files, either digital parsing, ocr - # parsing or layout parsing is supported. - # * `html`: Override parsing config for HTML files, only digital parsing and - # layout parsing are supported. - # * `docx`: Override parsing config for DOCX files, only digital parsing and - # layout parsing are supported. - # * `pptx`: Override parsing config for PPTX files, only digital parsing and - # layout parsing are supported. - # * `xlsm`: Override parsing config for XLSM files, only digital parsing and - # layout parsing are supported. - # * `xlsx`: Override parsing config for XLSX files, only digital parsing and - # layout parsing are supported. - class DocumentProcessingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for chunking config. - # @!attribute [rw] layout_based_chunking_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ChunkingConfig::LayoutBasedChunkingConfig] - # Configuration for the layout based chunking. - class ChunkingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for the layout based chunking. - # @!attribute [rw] chunk_size - # @return [::Integer] - # The token size limit for each chunk. - # - # Supported values: 100-500 (inclusive). - # Default value: 500. - # @!attribute [rw] include_ancestor_headings - # @return [::Boolean] - # Whether to include appending different levels of headings to chunks - # from the middle of the document to prevent context loss. - # - # Default value: False. - class LayoutBasedChunkingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Related configurations applied to a specific type of document parser. - # @!attribute [rw] digital_parsing_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::DigitalParsingConfig] - # Configurations applied to digital parser. - # - # Note: The following fields are mutually exclusive: `digital_parsing_config`, `ocr_parsing_config`, `layout_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ocr_parsing_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::OcrParsingConfig] - # Configurations applied to OCR parser. Currently it only applies to - # PDFs. - # - # Note: The following fields are mutually exclusive: `ocr_parsing_config`, `digital_parsing_config`, `layout_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] layout_parsing_config - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig::LayoutParsingConfig] - # Configurations applied to layout parser. - # - # Note: The following fields are mutually exclusive: `layout_parsing_config`, `digital_parsing_config`, `ocr_parsing_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The digital parsing configurations for documents. - class DigitalParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The OCR parsing configurations for documents. - # @!attribute [rw] enhanced_document_elements - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # [DEPRECATED] This field is deprecated. To use the additional enhanced - # document elements processing, please switch to `layout_parsing_config`. - # @!attribute [rw] use_native_text - # @return [::Boolean] - # If true, will use native text instead of OCR text on pages containing - # native text. - class OcrParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The layout parsing configurations for documents. - # @!attribute [rw] enable_table_annotation - # @return [::Boolean] - # Optional. If true, the LLM based annotation is added to the table - # during parsing. - # @!attribute [rw] enable_image_annotation - # @return [::Boolean] - # Optional. If true, the LLM based annotation is added to the image - # during parsing. - # @!attribute [rw] structured_content_types - # @return [::Array<::String>] - # Optional. Contains the required structure types to extract from the - # document. Supported values: - # - # * `shareholder-structure` - # @!attribute [rw] exclude_html_elements - # @return [::Array<::String>] - # Optional. List of HTML elements to exclude from the parsed content. - # @!attribute [rw] exclude_html_classes - # @return [::Array<::String>] - # Optional. List of HTML classes to exclude from the parsed content. - # @!attribute [rw] exclude_html_ids - # @return [::Array<::String>] - # Optional. List of HTML ids to exclude from the parsed content. - class LayoutParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig::ParsingConfig] - class ParsingConfigOverridesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb deleted file mode 100644 index 9202f2b69084..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +++ /dev/null @@ -1,313 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document DocumentService.GetDocument} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Document Document} does - # not exist, a `NOT_FOUND` error is returned. - class GetDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # method. - # @!attribute [rw] parent - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s under this branch, - # regardless of whether or not this branch exists, a `PERMISSION_DENIED` - # error is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. If unspecified, defaults to 100. The maximum allowed value is 1000. - # Values above 1000 are set to 1000. - # - # If this field is negative, an `INVALID_ARGUMENT` error is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token}, - # received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - class ListDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents DocumentService.ListDocuments} - # method. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document>] - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest#page_token ListDocumentsRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document DocumentService.CreateDocument} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @!attribute [rw] document - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Document Document} to - # create. - # @!attribute [rw] document_id - # @return [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, which becomes the - # final component of the - # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name}. - # - # If the caller does not have permission to create the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # This field must be unique among all - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with the same - # {::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent 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 128 characters. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - class CreateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document DocumentService.UpdateDocument} - # method. - # @!attribute [rw] document - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # Required. The document to update/create. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to update does - # not exist and - # {::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing allow_missing} - # is not set, a `NOT_FOUND` error is returned. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to `true` and the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not found, a new - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} is be created. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided imported 'document' to update. If - # not set, by default updates all fields. - class UpdateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document DocumentService.DeleteDocument} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}, regardless of whether - # or not it exists, a `PERMISSION_DENIED` error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Document Document} to delete does - # not exist, a `NOT_FOUND` error is returned. - class DeleteDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata DocumentService.BatchGetDocumentsMetadata} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @!attribute [rw] matcher - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher] - # Required. Matcher for the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - class BatchGetDocumentsMetadataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s by - # exact uris. - # @!attribute [rw] uris - # @return [::Array<::String>] - # The exact URIs to match by. - class UrisMatcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s by - # FHIR resource names. - # @!attribute [rw] fhir_resources - # @return [::Array<::String>] - # Required. The FHIR resources to match by. - # Format: - # projects/\\{project}/locations/\\{location}/datasets/\\{dataset}/fhirStores/\\{fhir_store}/fhir/\\{resource_type}/\\{fhir_resource_id} - class FhirMatcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - # Currently supports matching by exact URIs. - # @!attribute [rw] uris_matcher - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::UrisMatcher] - # Matcher by exact URIs. - # - # Note: The following fields are mutually exclusive: `uris_matcher`, `fhir_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] fhir_matcher - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::FhirMatcher] - # Matcher by FHIR resource names. - # - # Note: The following fields are mutually exclusive: `fhir_matcher`, `uris_matcher`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Matcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata DocumentService.BatchGetDocumentsMetadata} - # method. - # @!attribute [rw] documents_metadata - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::DocumentMetadata>] - # The metadata of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s. - class BatchGetDocumentsMetadataResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The metadata of a {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # @!attribute [rw] matcher_value - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::DocumentMetadata::MatcherValue] - # The value of the matcher that was used to match the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse::State] - # The state of the document. - # @!attribute [rw] last_refreshed_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp of the last time the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} was last indexed. - # @!attribute [rw] data_ingestion_source - # @return [::String] - # The data ingestion source of the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # Allowed values are: - # - # * `batch`: Data ingested via Batch API, e.g., ImportDocuments. - # * `streaming` Data ingested via Streaming API, e.g., FHIR streaming. - class DocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The value of the matcher that was used to match the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # @!attribute [rw] uri - # @return [::String] - # If match by URI, the URI of the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # - # Note: The following fields are mutually exclusive: `uri`, `fhir_resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] fhir_resource - # @return [::String] - # Format: - # projects/\\{project}/locations/\\{location}/datasets/\\{dataset}/fhirStores/\\{fhir_store}/fhir/\\{resource_type}/\\{fhir_resource_id} - # - # Note: The following fields are mutually exclusive: `fhir_resource`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class MatcherValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The state of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - module State - # Should never be set. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is indexed. - INDEXED = 1 - - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not indexed - # because its URI is not in the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}. - NOT_IN_TARGET_SITE = 2 - - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} is not indexed. - NOT_IN_INDEX = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb deleted file mode 100644 index 24ae3add7c9f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine.rb +++ /dev/null @@ -1,371 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Metadata that describes the training and serving parameters of an - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}. - # @!attribute [rw] chat_engine_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineConfig] - # Configurations for the Chat Engine. Only applicable if - # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}. - # - # Note: The following fields are mutually exclusive: `chat_engine_config`, `search_engine_config`, `media_recommendation_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] search_engine_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::SearchEngineConfig] - # Configurations for the Search Engine. Only applicable if - # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # - # Note: The following fields are mutually exclusive: `search_engine_config`, `chat_engine_config`, `media_recommendation_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] media_recommendation_engine_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig] - # Configurations for the Media Engine. Only applicable on the data - # stores with - # {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION} - # and - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # - # Note: The following fields are mutually exclusive: `media_recommendation_engine_config`, `chat_engine_config`, `search_engine_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] chat_engine_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineMetadata] - # Output only. Additional information of the Chat Engine. Only applicable - # if {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} - # is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}. - # @!attribute [rw] name - # @return [::String] - # Immutable. Identifier. The fully qualified resource name of the engine. - # - # This field must be a UTF-8 encoded string with a length limit of 1024 - # characters. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` - # engine should be 1-63 characters, and valid characters are - # /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the engine. Should be human readable. UTF-8 - # encoded string with limit of 1024 characters. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp the Recommendation Engine was created at. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp the Recommendation Engine was last updated. - # @!attribute [rw] data_store_ids - # @return [::Array<::String>] - # Optional. The data stores associated with this engine. - # - # For - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH} - # and - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION} - # type of engines, they can only associate with at most one data store. - # - # If {::Google::Cloud::DiscoveryEngine::V1::Engine#solution_type solution_type} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT SOLUTION_TYPE_CHAT}, - # multiple {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s in the - # same [Collection][google.cloud.discoveryengine.v1.Collection] can be - # associated here. - # - # Note that when used in - # {::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest CreateEngineRequest}, - # one DataStore id must be provided as the system will use it for necessary - # initializations. - # @!attribute [rw] solution_type - # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] - # Required. The solutions of the engine. - # @!attribute [rw] industry_vertical - # @return [::Google::Cloud::DiscoveryEngine::V1::IndustryVertical] - # Optional. The industry vertical that the engine registers. - # The restriction of the Engine industry vertical is based on - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}: Vertical on Engine - # has to match vertical of the DataStore linked to the engine. - # @!attribute [rw] common_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::CommonConfig] - # Common config spec that specifies the metadata of the engine. - # @!attribute [rw] disable_analytics - # @return [::Boolean] - # Optional. Whether to disable analytics for searches performed on this - # engine. - class Engine - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configurations for a Search Engine. - # @!attribute [rw] search_tier - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchTier] - # The search feature tier of this engine. - # - # Different tiers might have different - # pricing. To learn more, check the pricing documentation. - # - # Defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchTier::SEARCH_TIER_STANDARD SearchTier.SEARCH_TIER_STANDARD} - # if not specified. - # @!attribute [rw] search_add_ons - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchAddOn>] - # The add-on that this search engine enables. - class SearchEngineConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional config specs for a Media Recommendation engine. - # @!attribute [rw] type - # @return [::String] - # Required. The type of engine. e.g., `recommended-for-you`. - # - # This field together with - # {::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig#optimization_objective optimization_objective} - # describe engine metadata to use to control engine training and serving. - # - # Currently supported values: `recommended-for-you`, `others-you-may-like`, - # `more-like-this`, `most-popular-items`. - # @!attribute [rw] optimization_objective - # @return [::String] - # The optimization objective. e.g., `cvr`. - # - # This field together with - # {::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig#type optimization_objective} - # describe engine metadata to use to control engine training and serving. - # - # Currently supported - # values: `ctr`, `cvr`. - # - # If not specified, we choose default based on engine type. - # Default depends on type of recommendation: - # - # `recommended-for-you` => `ctr` - # - # `others-you-may-like` => `ctr` - # @!attribute [rw] optimization_objective_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::OptimizationObjectiveConfig] - # Name and value of the custom threshold for cvr optimization_objective. - # For target_field `watch-time`, target_field_value must be an integer - # value indicating the media progress time in seconds between (0, 86400] - # (excludes 0, includes 86400) (e.g., 90). - # For target_field `watch-percentage`, the target_field_value must be a - # valid float value between (0, 1.0] (excludes 0, includes 1.0) (e.g., - # 0.5). - # @!attribute [rw] training_state - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::TrainingState] - # The training state that the engine is in (e.g. - # `TRAINING` or `PAUSED`). - # - # Since part of the cost of running the service - # is frequency of training - this can be used to determine when to train - # engine in order to control cost. If not specified: the default value for - # `CreateEngine` method is `TRAINING`. The default value for - # `UpdateEngine` method is to keep the state the same as before. - # @!attribute [rw] engine_features_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::EngineFeaturesConfig] - # Optional. Additional engine features config. - class MediaRecommendationEngineConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Custom threshold for `cvr` optimization_objective. - # @!attribute [rw] target_field - # @return [::String] - # Required. The name of the field to target. Currently supported - # values: `watch-percentage`, `watch-time`. - # @!attribute [rw] target_field_value_float - # @return [::Float] - # Required. The threshold to be applied to the target (e.g., 0.5). - class OptimizationObjectiveConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # More feature configs of the selected engine type. - # @!attribute [rw] recommended_for_you_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::RecommendedForYouFeatureConfig] - # Recommended for you engine feature config. - # - # Note: The following fields are mutually exclusive: `recommended_for_you_config`, `most_popular_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] most_popular_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::MediaRecommendationEngineConfig::MostPopularFeatureConfig] - # Most popular engine feature config. - # - # Note: The following fields are mutually exclusive: `most_popular_config`, `recommended_for_you_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class EngineFeaturesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional feature configurations for creating a `recommended-for-you` - # engine. - # @!attribute [rw] context_event_type - # @return [::String] - # The type of event with which the engine is queried at prediction time. - # If set to `generic`, only `view-item`, `media-play`,and - # `media-complete` will be used as `context-event` in engine training. If - # set to `view-home-page`, `view-home-page` will also be used as - # `context-events` in addition to `view-item`, `media-play`, and - # `media-complete`. Currently supported for the `recommended-for-you` - # engine. Currently supported values: `view-home-page`, `generic`. - class RecommendedForYouFeatureConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Feature configurations that are required for creating a Most Popular - # engine. - # @!attribute [rw] time_window_days - # @return [::Integer] - # The time window of which the engine is queried at training and - # prediction time. Positive integers only. The value translates to the - # last X days of events. Currently required for the `most-popular-items` - # engine. - class MostPopularFeatureConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The training state of the engine. - module TrainingState - # Unspecified training state. - TRAINING_STATE_UNSPECIFIED = 0 - - # The engine training is paused. - PAUSED = 1 - - # The engine is training. - TRAINING = 2 - end - end - - # Configurations for a Chat Engine. - # @!attribute [rw] agent_creation_config - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineConfig::AgentCreationConfig] - # The configurationt generate the Dialogflow agent that is associated to - # this Engine. - # - # Note that these configurations are one-time consumed by - # and passed to Dialogflow service. It means they cannot be retrieved using - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} - # or - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # API after engine creation. - # @!attribute [rw] dialogflow_agent_to_link - # @return [::String] - # The resource name of an exist Dialogflow agent to link to this Chat - # Engine. Customers can either provide `agent_creation_config` to create - # agent or provide an agent name that links the agent with the Chat engine. - # - # Format: `projects//locations//agents/`. - # - # Note that the `dialogflow_agent_to_link` are one-time consumed by and - # passed to Dialogflow service. It means they cannot be retrieved using - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} - # or - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # API after engine creation. Use - # {::Google::Cloud::DiscoveryEngine::V1::Engine::ChatEngineMetadata#dialogflow_agent ChatEngineMetadata.dialogflow_agent} - # for actual agent association after Engine is created. - # @!attribute [rw] allow_cross_region - # @return [::Boolean] - # Optional. If the flag set to true, we allow the agent and engine are in - # different locations, otherwise the agent and engine are required to be in - # the same location. The flag is set to false by default. - # - # Note that the `allow_cross_region` are one-time consumed by and - # passed to - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine}. - # It means they cannot be retrieved using - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} - # or - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # API after engine creation. - class ChatEngineConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configurations for generating a Dialogflow agent. - # - # Note that these configurations are one-time consumed by - # and passed to Dialogflow service. It means they cannot be retrieved using - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} - # or - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # API after engine creation. - # @!attribute [rw] business - # @return [::String] - # Name of the company, organization or other entity that the agent - # represents. Used for knowledge connector LLM prompt and for knowledge - # search. - # @!attribute [rw] default_language_code - # @return [::String] - # Required. The default language of the agent as a language tag. - # See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. - # @!attribute [rw] time_zone - # @return [::String] - # Required. The time zone of the agent from the [time zone - # database](https://www.iana.org/time-zones), e.g., America/New_York, - # Europe/Paris. - # @!attribute [rw] location - # @return [::String] - # Agent location for Agent creation, supported values: global/us/eu. - # If not provided, us Engine will create Agent using us-central-1 by - # default; eu Engine will create Agent using eu-west-1 by default. - class AgentCreationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Common configurations for an Engine. - # @!attribute [rw] company_name - # @return [::String] - # The name of the company, business or entity that is associated with the - # engine. Setting this may help improve LLM related features. - class CommonConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional information of a Chat Engine. - # Fields in this message are output only. - # @!attribute [rw] dialogflow_agent - # @return [::String] - # The resource name of a Dialogflow agent, that this Chat Engine refers - # to. - # - # Format: `projects//locations//agents/`. - class ChatEngineMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb deleted file mode 100644 index 08d3e850460c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb +++ /dev/null @@ -1,177 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}`. - # @!attribute [rw] engine - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to create. - # @!attribute [rw] engine_id - # @return [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, which will become the - # final component of the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}'s - # resource name. - # - # 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. - class CreateEngineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine EngineService.CreateEngine} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class CreateEngineMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine EngineService.DeleteEngine} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # - # If the caller does not have permission to delete the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to delete does not - # exist, a NOT_FOUND error is returned. - class DeleteEngineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine EngineService.DeleteEngine} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteEngineMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine EngineService.GetEngine} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - class GetEngineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection_id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Not supported. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Not supported. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter by solution type. For example: - # solution_type=SOLUTION_TYPE_SEARCH - class ListEnginesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines EngineService.ListEngines} - # method. - # @!attribute [rw] engines - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Engine>] - # All the customer's {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s. - # @!attribute [rw] next_page_token - # @return [::String] - # Not supported. - class ListEnginesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine EngineService.UpdateEngine} - # method. - # @!attribute [rw] engine - # @return [::Google::Cloud::DiscoveryEngine::V1::Engine] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}, regardless of whether or - # not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update does not - # exist, a NOT_FOUND error is returned. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} to update. - # - # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error - # is returned. - class UpdateEngineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb deleted file mode 100644 index a3e1deb33767..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +++ /dev/null @@ -1,620 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Base structured datatype containing multi-part content of a message. - # @!attribute [rw] role - # @return [::String] - # Producer of the content. Must be either `user` or `model`. - # - # Intended to be used for multi-turn conversations. Otherwise, it can be left - # unset. - # @!attribute [rw] parts - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent::Part>] - # Ordered `Parts` that constitute a single message. - class GroundedGenerationContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Single part of content. - # @!attribute [rw] text - # @return [::String] - # Inline text. - class Part - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Top-level message sent by the client for the `GenerateGroundedContent` - # method. - # @!attribute [rw] location - # @return [::String] - # Required. Location resource. - # - # Format: `projects/{project}/locations/{location}`. - # @!attribute [rw] system_instruction - # @return [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent] - # Content of the system instruction for the current API. - # - # These instructions will take priority over any other prompt instructions - # if the selected model is supporting them. - # @!attribute [rw] contents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent>] - # Content of the current conversation with the model. - # - # For single-turn queries, this is a single instance. For multi-turn queries, - # this is a repeated field that contains conversation history + latest - # request. - # @!attribute [rw] generation_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec] - # Content generation specification. - # @!attribute [rw] grounding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec] - # Grounding specification. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - class GenerateGroundedContentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Content generation specification. - # @!attribute [rw] model_id - # @return [::String] - # Specifies which Vertex model id to use for generation. - # @!attribute [rw] language_code - # @return [::String] - # Language code for content. Use language tags defined by - # [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - # @!attribute [rw] temperature - # @return [::Float] - # If specified, custom value for the temperature will be used. - # @!attribute [rw] top_p - # @return [::Float] - # If specified, custom value for nucleus sampling will be used. - # @!attribute [rw] top_k - # @return [::Integer] - # If specified, custom value for top-k sampling will be used. - # @!attribute [rw] frequency_penalty - # @return [::Float] - # If specified, custom value for frequency penalty will be used. - # @!attribute [rw] seed - # @return [::Integer] - # If specified, custom value for the seed will be used. - # @!attribute [rw] presence_penalty - # @return [::Float] - # If specified, custom value for presence penalty will be used. - # @!attribute [rw] max_output_tokens - # @return [::Integer] - # If specified, custom value for max output tokens will be used. - class GenerationSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the options to customize dynamic retrieval. - # @!attribute [rw] predictor - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor] - # Specification for the predictor for dynamic retrieval. - class DynamicRetrievalConfiguration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the predictor settings for dynamic retrieval. - # @!attribute [rw] version - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration::DynamicRetrievalPredictor::Version] - # The version of the predictor to be used in dynamic retrieval. - # @!attribute [rw] threshold - # @return [::Float] - # The value of the threshold. If the predictor will predict a - # value smaller than this, it would suppress grounding in the source. - class DynamicRetrievalPredictor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The version of the predictor to be used in dynamic retrieval. - module Version - # Automatically choose the best version of the retrieval predictor. - VERSION_UNSPECIFIED = 0 - - # The V1 model which is evaluating each source independently. - V1_INDEPENDENT = 1 - end - end - end - - # Grounding source. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::InlineSource] - # If set, grounding is performed with inline content. - # - # Note: The following fields are mutually exclusive: `inline_source`, `search_source`, `google_search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] search_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::SearchSource] - # If set, grounding is performed with Vertex AI Search. - # - # Note: The following fields are mutually exclusive: `search_source`, `inline_source`, `google_search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] google_search_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::GoogleSearchSource] - # If set, grounding is performed with Google Search. - # - # Note: The following fields are mutually exclusive: `google_search_source`, `inline_source`, `search_source`, `enterprise_web_retrieval_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] enterprise_web_retrieval_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource::EnterpriseWebRetrievalSource] - # If set, grounding is performed with enterprise web retrieval. - # - # Note: The following fields are mutually exclusive: `enterprise_web_retrieval_source`, `inline_source`, `search_source`, `google_search_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class GroundingSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message to be used for grounding based on inline content. - # @!attribute [rw] grounding_facts - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact>] - # List of facts to be used for grounding. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attributes associated with the content. - # - # Common attributes include `source` (indicating where the content was - # sourced from) and `author` (indicating the author of the content). - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message to be used for grounding with Vertex AI Search. - # @!attribute [rw] serving_config - # @return [::String] - # The resource name of the Engine to use. - # - # Format: - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` - # @!attribute [rw] max_result_count - # @return [::Integer] - # Number of search results to return. - # - # The default value is 10. The maximumm allowed value is 10. - # @!attribute [rw] filter - # @return [::String] - # Filter expression to be applied to the search. - # - # The syntax is the same as - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @!attribute [rw] safe_search - # @return [::Boolean] - # If set, safe search is enabled in Vertex AI Search requests. - class SearchSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Google Search config parameters. - # @!attribute [rw] dynamic_retrieval_config - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::DynamicRetrievalConfiguration] - # Optional. Specifies the dynamic retrieval configuration for the given - # source. - class GoogleSearchSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Params for using enterprise web retrieval as grounding source. - class EnterpriseWebRetrievalSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Grounding specification. - # @!attribute [rw] grounding_sources - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSource>] - # Grounding sources. - class GroundingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response for the `GenerateGroundedContent` method. - # @!attribute [rw] candidates - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate>] - # Generated candidates. - class GenerateGroundedContentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A response candidate generated from the model. - # @!attribute [rw] index - # @return [::Integer] - # Index of the candidate. - # @!attribute [rw] content - # @return [::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent] - # Content of the candidate. - # @!attribute [rw] grounding_score - # @return [::Float] - # The overall grounding score for the candidate, in the range of [0, 1]. - # @!attribute [rw] grounding_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata] - # Grounding metadata for the generated content. - class Candidate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Citation for the generated content. - # @!attribute [rw] retrieval_metadata - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata>] - # Retrieval metadata to provide an understanding in the - # retrieval steps performed by the model. There can be multiple such - # messages which can correspond to different parts of the retrieval. This - # is a mechanism used to ensure transparency to our users. - # @!attribute [rw] support_chunks - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FactChunk>] - # List of chunks to be attributed across all claims in the candidate. - # These are derived from the grounding sources supplied in the request. - # @!attribute [rw] web_search_queries - # @return [::Array<::String>] - # Web search queries for the following-up web search. - # @!attribute [rw] search_entry_point - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::SearchEntryPoint] - # Google search entry for the following-up web searches. - # @!attribute [rw] grounding_support - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::GroundingSupport>] - # GroundingSupport across all claims in the answer candidate. - # An support to a fact indicates that the claim is supported by - # the fact. - # @!attribute [rw] images - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata>] - # Images from the web search. - class GroundingMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the metadata associated with a retrieval step. - # @!attribute [rw] source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::RetrievalMetadata::Source] - # Describes the source to which the metadata is referring to. - # @!attribute [rw] dynamic_retrieval_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalMetadata] - # Metadata for dynamic retrieval. - class RetrievalMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the source to which the metadata is associated to. - module Source - # Unspecified source. - SOURCE_UNSPECIFIED = 0 - - # Vertex AI search. - VERTEX_AI_SEARCH = 1 - - # Google Search. - GOOGLE_SEARCH = 3 - - # User inline provided content. - INLINE_CONTENT = 2 - - # Google Maps. - GOOGLE_MAPS = 4 - end - end - - # Describes the metadata about dynamic retrieval. - # @!attribute [rw] predictor_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata] - # Metadata for the dynamic retrieval predictor. - class DynamicRetrievalMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the metadata about the dynamic retrieval predictor. - # @!attribute [rw] version - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::DynamicRetrievalPredictorMetadata::Version] - # The version of the predictor which was used in dynamic retrieval. - # @!attribute [rw] prediction - # @return [::Float] - # The value of the predictor. This should be between [0, 1] where - # a value of 0 means that the query would not benefit from grounding, - # while a value of 1.0 means that the query would benefit the most. - # In between values allow to differentiate between different usefulness - # scores for grounding. - class DynamicRetrievalPredictorMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The version of the predictor which was used in dynamic retrieval. - module Version - # Unspecified version, should never be used. - VERSION_UNSPECIFIED = 0 - - # The V1 model which is evaluating each source independently. - V1_INDEPENDENT = 1 - end - end - - # Google search entry point. - # @!attribute [rw] rendered_content - # @return [::String] - # Web content snippet that can be embedded in a web page or an app - # webview. - # @!attribute [rw] sdk_blob - # @return [::String] - # Base64 encoded JSON representing array of - # tuple. - class SearchEntryPoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Grounding info for a claim in the candidate and its support. - # @!attribute [rw] claim_text - # @return [::String] - # Text for the claim in the candidate. Always provided when a - # support is found. - # @!attribute [rw] support_chunk_indices - # @return [::Array<::Integer>] - # A list of indices (into 'support_chunks') specifying the - # citations associated with the claim. For instance [1,3,4] means - # that support_chunks[1], support_chunks[3], - # support_chunks[4] are the chunks attributed to the claim. - # @!attribute [rw] support_score - # @return [::Float] - # A score in the range of [0, 1] describing how grounded is a specific - # claim in the support chunks indicated. - # Higher value means that the claim is better supported by the chunks. - class GroundingSupport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about an image from the web search. - # @!attribute [rw] image - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image] - # Metadata about the full size image. - # @!attribute [rw] thumbnail - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::Image] - # Metadata about the thumbnail. - # @!attribute [rw] source - # @return [::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse::Candidate::GroundingMetadata::ImageMetadata::WebsiteInfo] - # The details about the website that the image is from. - class ImageMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata about the website that the image is from. - # @!attribute [rw] uri - # @return [::String] - # The url of the website. - # @!attribute [rw] title - # @return [::String] - # The title of the website. - class WebsiteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about the image. - # @!attribute [rw] uri - # @return [::String] - # The url of the image. - # @!attribute [rw] width - # @return [::Integer] - # The width of the image in pixels. - # @!attribute [rw] height - # @return [::Integer] - # The height of the image in pixels. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - - # Specification for the grounding check. - # @!attribute [rw] citation_threshold - # @return [::Float] - # The threshold (in [0,1]) used for determining whether a fact must be - # cited for a claim in the answer candidate. Choosing a higher threshold - # will lead to fewer but very strong citations, while choosing a lower - # threshold may lead to more but somewhat weaker citations. If unset, the - # threshold will default to 0.6. - # @!attribute [rw] enable_claim_level_score - # @return [::Boolean] - # The control flag that enables claim-level grounding score in the response. - class CheckGroundingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding GroundedGenerationService.CheckGrounding} - # method. - # @!attribute [rw] grounding_config - # @return [::String] - # Required. The resource name of the grounding config, such as - # `projects/*/locations/global/groundingConfigs/default_grounding_config`. - # @!attribute [rw] answer_candidate - # @return [::String] - # Answer candidate to check. It can have a maximum length of 4096 tokens. - # @!attribute [rw] facts - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::GroundingFact>] - # List of facts for the grounding check. - # We support up to 200 facts. - # @!attribute [rw] grounding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec] - # Configuration of the grounding check. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - class CheckGroundingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for the - # {::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding GroundedGenerationService.CheckGrounding} - # method. - # @!attribute [rw] support_score - # @return [::Float] - # The support score for the input answer candidate. - # Higher the score, higher is the fraction of claims that are supported by - # the provided facts. This is always set when a response is returned. - # @!attribute [rw] cited_chunks - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FactChunk>] - # List of facts cited across all claims in the answer candidate. - # These are derived from the facts supplied in the request. - # @!attribute [rw] cited_facts - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::CheckGroundingFactChunk>] - # List of facts cited across all claims in the answer candidate. - # These are derived from the facts supplied in the request. - # @!attribute [rw] claims - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::Claim>] - # Claim texts and citation info across all claims in the answer candidate. - class CheckGroundingResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Fact chunk for grounding check. - # @!attribute [rw] chunk_text - # @return [::String] - # Text content of the fact chunk. Can be at most 10K characters long. - class CheckGroundingFactChunk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Text and citation info for a claim in the answer candidate. - # @!attribute [rw] start_pos - # @return [::Integer] - # Position indicating the start of the claim in the answer candidate, - # measured in bytes. Note that this is not measured in characters and, - # therefore, must be rendered in the user interface keeping in mind that - # some characters may take more than one byte. For example, - # if the claim text contains non-ASCII characters, the start and end - # positions vary when measured in characters - # (programming-language-dependent) and when measured in bytes - # (programming-language-independent). - # @!attribute [rw] end_pos - # @return [::Integer] - # Position indicating the end of the claim in the answer candidate, - # exclusive, in bytes. Note that this is not measured in characters and, - # therefore, must be rendered as such. For example, if the claim text - # contains non-ASCII characters, the start and end positions vary when - # measured in characters (programming-language-dependent) and when measured - # in bytes (programming-language-independent). - # @!attribute [rw] claim_text - # @return [::String] - # Text for the claim in the answer candidate. Always provided regardless of - # whether citations or anti-citations are found. - # @!attribute [rw] citation_indices - # @return [::Array<::Integer>] - # A list of indices (into 'cited_chunks') specifying the citations - # associated with the claim. For instance [1,3,4] means that - # cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited - # supporting for the claim. A citation to a fact indicates that the claim - # is supported by the fact. - # @!attribute [rw] grounding_check_required - # @return [::Boolean] - # Indicates that this claim required grounding check. When the system - # decided this claim doesn't require attribution/grounding check, this - # field will be set to false. In that case, no grounding check was done for - # the claim and therefore - # {::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse::Claim#citation_indices citation_indices} - # should not be returned. - # @!attribute [rw] score - # @return [::Float] - # Confidence score for the claim in the answer candidate, in the range of - # [0, 1]. This is set only when - # `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true. - class Claim - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb deleted file mode 100644 index ee7063d2acb8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Grounding Fact. - # @!attribute [rw] fact_text - # @return [::String] - # Text content of the fact. Can be at most 10K characters long. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::String}] - # Attributes associated with the fact. - # Common attributes include `source` (indicating where the fact was sourced - # from), `author` (indicating the author of the fact), and so on. - class GroundingFact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Fact Chunk. - # @!attribute [rw] chunk_text - # @return [::String] - # Text content of the fact chunk. Can be at most 10K characters long. - # @!attribute [rw] source - # @return [::String] - # Source from which this fact chunk was retrieved. If it was retrieved - # from the GroundingFacts provided in the request then this field will - # contain the index of the specific fact from which this chunk was - # retrieved. - # @!attribute [rw] index - # @return [::Integer] - # The index of this chunk. Currently, only used for the streaming mode. - # @!attribute [rw] source_metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # More fine-grained information for the source reference. - # @!attribute [rw] uri - # @return [::String] - # The URI of the source. - # @!attribute [rw] title - # @return [::String] - # The title of the source. - # @!attribute [rw] domain - # @return [::String] - # The domain of the source. - class FactChunk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class SourceMetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb deleted file mode 100644 index 7e0dbe930da9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Identity Mapping Store which contains Identity Mapping Entries. - # @!attribute [rw] name - # @return [::String] - # Immutable. The full resource name of the identity mapping store. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}`. - # This field must be a UTF-8 encoded string with a length limit of 1024 - # characters. - # @!attribute [rw] kms_key_name - # @return [::String] - # Input only. The KMS key to be used to protect this Identity Mapping Store - # at creation time. - # - # Must be set for requests that need to comply with CMEK Org Policy - # protections. - # - # If this field is set and processed successfully, the Identity Mapping Store - # will be protected by the KMS key, as indicated in the cmek_config field. - # @!attribute [r] cmek_config - # @return [::Google::Cloud::DiscoveryEngine::V1::CmekConfig] - # Output only. CMEK-related information for the Identity Mapping Store. - class IdentityMappingStore - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identity Mapping Entry that maps an external identity to an internal - # identity. - # @!attribute [rw] user_id - # @return [::String] - # User identifier. - # For Google Workspace user account, user_id should be the google workspace - # user email. - # For non-google identity provider, user_id is the mapped user identifier - # configured during the workforcepool config. - # - # Note: The following fields are mutually exclusive: `user_id`, `group_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] group_id - # @return [::String] - # Group identifier. - # For Google Workspace user account, group_id should be the google - # workspace group email. - # For non-google identity provider, group_id is the mapped group identifier - # configured during the workforcepool config. - # - # Note: The following fields are mutually exclusive: `group_id`, `user_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] external_identity - # @return [::String] - # Required. Identity outside the customer identity provider. - # The length limit of external identity will be of 100 characters. - class IdentityMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb deleted file mode 100644 index 532656e9fbf8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb +++ /dev/null @@ -1,279 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store IdentityMappingStoreService.CreateIdentityMappingStore} - # @!attribute [rw] cmek_config_name - # @return [::String] - # Resource name of the CmekConfig to use for protecting this Identity - # Mapping Store. - # - # Note: The following fields are mutually exclusive: `cmek_config_name`, `disable_cmek`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] disable_cmek - # @return [::Boolean] - # Identity Mapping Store without CMEK protections. If a default CmekConfig - # is set for the project, setting this field will override the default - # CmekConfig as well. - # - # Note: The following fields are mutually exclusive: `disable_cmek`, `cmek_config_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent collection resource name, such as - # `projects/{project}/locations/{location}`. - # @!attribute [rw] identity_mapping_store_id - # @return [::String] - # Required. The ID of the Identity Mapping Store to create. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - # (_), and hyphens (-). The maximum length is 63 characters. - # @!attribute [rw] identity_mapping_store - # @return [::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore] - # Required. The Identity Mapping Store to create. - class CreateIdentityMappingStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store IdentityMappingStoreService.GetIdentityMappingStore} - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Identity Mapping Store to get. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - class GetIdentityMappingStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store IdentityMappingStoreService.DeleteIdentityMappingStore} - # @!attribute [rw] name - # @return [::String] - # Required. The name of the Identity Mapping Store to delete. - # Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - class DeleteIdentityMappingStoreRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource] - # The inline source to import identity mapping entries from. - # @!attribute [rw] identity_mapping_store - # @return [::String] - # Required. The name of the Identity Mapping Store to import Identity Mapping - # Entries to. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - class ImportIdentityMappingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source to import identity mapping entries from. - # @!attribute [rw] identity_mapping_entries - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # A maximum of 10000 entries can be imported at one time - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - class ImportIdentityMappingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings IdentityMappingStoreService.PurgeIdentityMappings} - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource] - # The inline source to purge identity mapping entries from. - # @!attribute [rw] identity_mapping_store - # @return [::String] - # Required. The name of the Identity Mapping Store to purge Identity Mapping - # Entries from. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @!attribute [rw] filter - # @return [::String] - # Filter matching identity mappings to purge. - # The eligible field for filtering is: - # * `update_time`: in ISO 8601 "zulu" format. - # * `external_id` - # - # Examples: - # - # * Deleting all identity mappings updated in a time range: - # `update_time > "2012-04-23T18:25:43.511Z" AND update_time < - # "2012-04-23T18:30:43.511Z"` - # * Deleting all identity mappings for a given external_id: - # `external_id = "id1"` - # * Deleting all identity mappings inside an identity mapping store: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # Should not be used with source. An error will be thrown, if both are - # provided. - # @!attribute [rw] force - # @return [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any identity mappings. This field is - # only supported for purge with filter. For input source this field is - # ignored and data will be purged regardless of the value of this field. - class PurgeIdentityMappingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source to purge identity mapping entries from. - # @!attribute [rw] identity_mapping_entries - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # A maximum of 10000 entries can be purged at one time - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings IdentityMappingStoreService.ListIdentityMappings} - # @!attribute [rw] identity_mapping_store - # @return [::String] - # Required. The name of the Identity Mapping Store to list Identity Mapping - # Entries in. Format: - # `projects/{project}/locations/{location}/identityMappingStores/{identityMappingStore}` - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of IdentityMappings to return. If unspecified, defaults - # to 2000. The maximum allowed value is 10000. Values above 10000 will be - # coerced to 10000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListIdentityMappings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappings` must match the call that provided the page - # token. - class ListIdentityMappingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings IdentityMappingStoreService.ListIdentityMappings} - # @!attribute [rw] identity_mapping_entries - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry>] - # The Identity Mapping Entries. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. If this - # field is omitted, there are no subsequent pages. - class ListIdentityMappingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores IdentityMappingStoreService.ListIdentityMappingStores} - # @!attribute [rw] parent - # @return [::String] - # Required. The parent of the Identity Mapping Stores to list. - # Format: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of IdentityMappingStores to return. If unspecified, defaults - # to 100. The maximum allowed value is 1000. Values above 1000 will be - # coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListIdentityMappingStores` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListIdentityMappingStores` must match the call that provided the page - # token. - class ListIdentityMappingStoresRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores IdentityMappingStoreService.ListIdentityMappingStores} - # @!attribute [rw] identity_mapping_stores - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore>] - # The Identity Mapping Stores. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. If this - # field is omitted, there are no subsequent pages. - class ListIdentityMappingStoresResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # IdentityMappingEntry LongRunningOperation metadata for - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings IdentityMappingStoreService.ImportIdentityMappings} - # and - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings IdentityMappingStoreService.PurgeIdentityMappings} - # @!attribute [rw] success_count - # @return [::Integer] - # The number of IdentityMappingEntries that were successfully processed. - # @!attribute [rw] failure_count - # @return [::Integer] - # The number of IdentityMappingEntries that failed to be processed. - # @!attribute [rw] total_count - # @return [::Integer] - # The total number of IdentityMappingEntries that were processed. - class IdentityMappingEntryOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store IdentityMappingStoreService.DeleteIdentityMappingStore} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteIdentityMappingStoreMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb deleted file mode 100644 index 2031993a5973..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +++ /dev/null @@ -1,867 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Cloud Storage location for input content. - # @!attribute [rw] input_uris - # @return [::Array<::String>] - # Required. Cloud Storage URIs to input files. Each 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`). - # @!attribute [rw] data_schema - # @return [::String] - # The schema to use when parsing the data from the source. - # - # Supported values for document imports: - # - # * `document` (default): One JSON - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} per line. Each - # document must - # have a valid {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the - # data store. This can only be used by the GENERIC Data Store vertical. - # * `csv`: A CSV file with header conforming to the defined - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the - # data store. Each entry after the header is imported as a Document. - # This can only be used by the GENERIC Data Store vertical. - # - # Supported values for user event imports: - # - # * `user_event` (default): One JSON - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} per line. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # BigQuery source import data from. - # @!attribute [rw] partition_date - # @return [::Google::Type::Date] - # BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. - # @!attribute [rw] project_id - # @return [::String] - # The project ID or the project number that contains the BigQuery source. Has - # a length limit of 128 characters. If not specified, inherits the project - # ID from the parent request. - # @!attribute [rw] dataset_id - # @return [::String] - # Required. The BigQuery data set to copy the data from with a length limit - # of 1,024 characters. - # @!attribute [rw] table_id - # @return [::String] - # Required. The BigQuery table to copy the data from with a length limit of - # 1,024 characters. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # 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. - # @!attribute [rw] data_schema - # @return [::String] - # The schema to use when parsing the data from the source. - # - # Supported values for user event imports: - # - # * `user_event` (default): One - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} per row. - # - # Supported values for document imports: - # - # * `document` (default): One - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} format per - # row. Each document must have a valid - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} and one of - # {::Google::Cloud::DiscoveryEngine::V1::Document#json_data Document.json_data} - # or - # {::Google::Cloud::DiscoveryEngine::V1::Document#struct_data Document.struct_data}. - # * `custom`: One custom data per row in arbitrary format that conforms to - # the defined {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} of the data - # store. This can only be used by the GENERIC Data Store vertical. - class BigQuerySource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Spanner source for importing data - # @!attribute [rw] project_id - # @return [::String] - # The project ID that contains the Spanner source. Has a length limit of 128 - # characters. If not specified, inherits the project ID from the parent - # request. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The instance ID of the source Spanner table. - # @!attribute [rw] database_id - # @return [::String] - # Required. The database ID of the source Spanner table. - # @!attribute [rw] table_id - # @return [::String] - # Required. The table name of the Spanner database that needs to be imported. - # @!attribute [rw] enable_data_boost - # @return [::Boolean] - # Whether to apply data boost on Spanner export. Enabling this option will - # incur additional cost. More info can be found - # [here](https://cloud.google.com/spanner/docs/databoost/databoost-overview#billing_and_quotas). - class SpannerSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Bigtable Options object that contains information to support - # the import. - # @!attribute [rw] key_field_name - # @return [::String] - # The field name used for saving row key value in the document. The name has - # to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. - # @!attribute [rw] families - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumnFamily}] - # The mapping from family names to an object that contains column families - # level information for the given column family. If a family is not present - # in this map it will be ignored. - class BigtableOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The column family of the Bigtable. - # @!attribute [rw] field_name - # @return [::String] - # The field name to use for this column family in the document. The - # name has to match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. If not set, - # it is parsed from the family name with best effort. However, due to - # different naming patterns, field name collisions could happen, where - # parsing behavior is undefined. - # @!attribute [rw] encoding - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Encoding] - # The encoding mode of the values when the type is not STRING. - # Acceptable encoding values are: - # - # * `TEXT`: indicates values are alphanumeric text strings. - # * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` - # family of functions. This can be overridden for a specific column - # by listing that column in `columns` and specifying an encoding for it. - # @!attribute [rw] type - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Type] - # The type of values in this column family. - # The values are expected to be encoded using `HBase Bytes.toBytes` - # function when the encoding value is set to `BINARY`. - # @!attribute [rw] columns - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumn>] - # The list of objects that contains column level information for each - # column. If a column is not present in this list it will be ignored. - class BigtableColumnFamily - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The column of the Bigtable. - # @!attribute [rw] qualifier - # @return [::String] - # Required. Qualifier of the column. If it cannot be decoded with utf-8, - # use a base-64 encoded string instead. - # @!attribute [rw] field_name - # @return [::String] - # The field name to use for this column in the document. The name has to - # match the pattern `[a-zA-Z0-9][a-zA-Z0-9-_]*`. - # If not set, it is parsed from the qualifier bytes with best effort. - # However, due to different naming patterns, field name collisions could - # happen, where parsing behavior is undefined. - # @!attribute [rw] encoding - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Encoding] - # The encoding mode of the values when the type is not `STRING`. - # Acceptable encoding values are: - # - # * `TEXT`: indicates values are alphanumeric text strings. - # * `BINARY`: indicates values are encoded using `HBase Bytes.toBytes` - # family of functions. This can be overridden for a specific column - # by listing that column in `columns` and specifying an encoding for it. - # @!attribute [rw] type - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::Type] - # The type of values in this column family. - # The values are expected to be encoded using `HBase Bytes.toBytes` - # function when the encoding value is set to `BINARY`. - class BigtableColumn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions::BigtableColumnFamily] - class FamiliesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of values in a Bigtable column or column family. - # The values are expected to be encoded using - # [HBase - # Bytes.toBytes](https://hbase.apache.org/1.4/apidocs/org/apache/hadoop/hbase/util/Bytes.html) - # function when the encoding value is set to `BINARY`. - module Type - # The type is unspecified. - TYPE_UNSPECIFIED = 0 - - # String type. - STRING = 1 - - # Numerical type. - NUMBER = 2 - - # Integer type. - INTEGER = 3 - - # Variable length integer type. - VAR_INTEGER = 4 - - # BigDecimal type. - BIG_NUMERIC = 5 - - # Boolean type. - BOOLEAN = 6 - - # JSON type. - JSON = 7 - end - - # The encoding mode of a Bigtable column or column family. - module Encoding - # The encoding is unspecified. - ENCODING_UNSPECIFIED = 0 - - # Text encoding. - TEXT = 1 - - # Binary encoding. - BINARY = 2 - end - end - - # The Cloud Bigtable source for importing data. - # @!attribute [rw] project_id - # @return [::String] - # The project ID that contains the Bigtable source. Has a length limit of 128 - # characters. If not specified, inherits the project ID from the parent - # request. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The instance ID of the Cloud Bigtable that needs to be imported. - # @!attribute [rw] table_id - # @return [::String] - # Required. The table ID of the Cloud Bigtable that needs to be imported. - # @!attribute [rw] bigtable_options - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableOptions] - # Required. Bigtable options that contains information needed when parsing - # data into typed structures. For example, column type annotations. - class BigtableSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud FhirStore source import data from. - # @!attribute [rw] fhir_store - # @return [::String] - # Required. The full resource name of the FHIR store to import data from, in - # the format of - # `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}`. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # 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 - # FhirStore export to a specific Cloud Storage directory. - # @!attribute [rw] resource_types - # @return [::Array<::String>] - # The FHIR resource types to import. The resource types should be a subset of - # all [supported FHIR resource - # types](https://cloud.google.com/generative-ai-app-builder/docs/fhir-schema-reference#resource-level-specification). - # Default to all supported FHIR resource types if empty. - # @!attribute [rw] update_from_latest_predefined_schema - # @return [::Boolean] - # Optional. Whether to update the DataStore schema to the latest predefined - # schema. - # - # If true, the DataStore schema will be updated to include any FHIR fields - # or resource types that have been added since the last import and - # corresponding FHIR resources will be imported from the FHIR store. - # - # Note this field cannot be used in conjunction with `resource_types`. It - # should be used after initial import. - class FhirStoreSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud SQL source import data from. - # @!attribute [rw] project_id - # @return [::String] - # The project ID that contains the Cloud SQL source. Has a length limit of - # 128 characters. If not specified, inherits the project ID from the parent - # request. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The Cloud SQL instance to copy the data from with a length limit - # of 256 characters. - # @!attribute [rw] database_id - # @return [::String] - # Required. The Cloud SQL database to copy the data from with a length limit - # of 256 characters. - # @!attribute [rw] table_id - # @return [::String] - # Required. The Cloud SQL table to copy the data from with a length limit of - # 256 characters. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # 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 - # Cloud SQL export to a specific Cloud Storage directory. - # - # Ensure that the Cloud SQL service account has the necessary Cloud - # Storage Admin permissions to access the specified Cloud Storage directory. - # @!attribute [rw] offload - # @return [::Boolean] - # Option for serverless export. Enabling this option will incur additional - # cost. More info can be found - # [here](https://cloud.google.com/sql/pricing#serverless). - class CloudSqlSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AlloyDB source import data from. - # @!attribute [rw] project_id - # @return [::String] - # The project ID that contains the AlloyDB source. - # Has a length limit of 128 characters. If not specified, inherits the - # project ID from the parent request. - # @!attribute [rw] location_id - # @return [::String] - # Required. The AlloyDB location to copy the data from with a length limit of - # 256 characters. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The AlloyDB cluster to copy the data from with a length limit of - # 256 characters. - # @!attribute [rw] database_id - # @return [::String] - # Required. The AlloyDB database to copy the data from with a length limit of - # 256 characters. - # @!attribute [rw] table_id - # @return [::String] - # Required. The AlloyDB table to copy the data from with a length limit of - # 256 characters. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # 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 - # AlloyDB export to a specific Cloud Storage directory. - # - # Ensure that the AlloyDB service account has the necessary Cloud - # Storage Admin permissions to access the specified Cloud Storage directory. - class AlloyDbSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Firestore source import data from. - # @!attribute [rw] project_id - # @return [::String] - # The project ID that the Cloud SQL source is in with a length limit of 128 - # characters. If not specified, inherits the project ID from the parent - # request. - # @!attribute [rw] database_id - # @return [::String] - # Required. The Firestore database to copy the data from with a length limit - # of 256 characters. - # @!attribute [rw] collection_id - # @return [::String] - # Required. The Firestore collection (or entity) to copy the data from with a - # length limit of 1,500 characters. - # @!attribute [rw] gcs_staging_dir - # @return [::String] - # 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 - # Firestore export to a specific Cloud Storage directory. - # - # Ensure that the Firestore service account has the necessary Cloud - # Storage Admin permissions to access the specified Cloud Storage directory. - class FirestoreSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of destination for Import related errors. - # @!attribute [rw] gcs_prefix - # @return [::String] - # 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. - class ImportErrorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the ImportUserEvents request. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource] - # The Inline source for the input content for UserEvents. - # - # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] - # Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bigquery_source - # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] - # BigQuery input source. - # - # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent DataStore resource name, of the form - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # The desired location of errors incurred during the Import. Cannot be set - # for inline user event imports. - class ImportUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for the input config for ImportUserEvents method. - # @!attribute [rw] user_events - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserEvent>] - # Required. A list of user events to import. Recommended max of 10k items. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # 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. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # Echoes the destination for the complete errors if this field was set in - # the request. - # @!attribute [rw] joined_events_count - # @return [::Integer] - # Count of user events imported with complete existing Documents. - # @!attribute [rw] unjoined_events_count - # @return [::Integer] - # Count of user events imported, but with Document information not found - # in the existing Branch. - class ImportUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the Import operation. This is - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were processed successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - class ImportUserEventsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the ImportDocuments operation. This is - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were processed successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - # @!attribute [rw] total_count - # @return [::Integer] - # Total count of entries that were processed. - class ImportDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for Import methods. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource] - # The Inline source for the input content for documents. - # - # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] - # Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bigquery_source - # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] - # BigQuery input source. - # - # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] fhir_store_source - # @return [::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource] - # FhirStore input source. - # - # Note: The following fields are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] spanner_source - # @return [::Google::Cloud::DiscoveryEngine::V1::SpannerSource] - # Spanner input source. - # - # Note: The following fields are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] cloud_sql_source - # @return [::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource] - # Cloud SQL input source. - # - # Note: The following fields are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] firestore_source - # @return [::Google::Cloud::DiscoveryEngine::V1::FirestoreSource] - # Firestore input source. - # - # Note: The following fields are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] alloy_db_source - # @return [::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource] - # AlloyDB input source. - # - # Note: The following fields are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bigtable_source - # @return [::Google::Cloud::DiscoveryEngine::V1::BigtableSource] - # Cloud Bigtable input source. - # - # Note: The following fields are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent branch resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # Requires create/update permission. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # The desired location of errors incurred during the Import. - # @!attribute [rw] reconciliation_mode - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode] - # The mode of reconciliation between existing documents and the documents to - # be imported. Defaults to - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided imported documents to update. If - # not set, the default is to update all fields. - # @!attribute [rw] auto_generate_ids - # @return [::Boolean] - # Whether to automatically generate IDs for the documents if absent. - # - # If set to `true`, - # {::Google::Cloud::DiscoveryEngine::V1::Document#id 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL ReconciliationMode.FULL} - # is highly recommended to avoid duplicate contents. If unset or set to - # `false`, {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s have - # to be specified using - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field id_field}, - # otherwise, documents without IDs fail to be imported. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @!attribute [rw] id_field - # @return [::String] - # The field indicates the ID field or column to be used as unique IDs of - # the documents. - # - # For {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource} it is the key of - # the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`. - # For others, it may be the column name of the table where the unique ids are - # stored. - # - # The values of the JSON field or the table column are used as the - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}s. The JSON field - # or the table 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 - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids 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. - # - # Supported data sources: - # - # * {::Google::Cloud::DiscoveryEngine::V1::GcsSource GcsSource}. - # {::Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema GcsSource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource BigQuerySource}. - # {::Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema BigQuerySource.data_schema} - # must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown. - # * {::Google::Cloud::DiscoveryEngine::V1::SpannerSource SpannerSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource CloudSqlSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::FirestoreSource FirestoreSource}. - # * {::Google::Cloud::DiscoveryEngine::V1::BigtableSource BigtableSource}. - # @!attribute [rw] force_refresh_content - # @return [::Boolean] - # Optional. Whether to force refresh the unstructured content of the - # documents. - # - # If set to `true`, the content part of the documents will be refreshed - # regardless of the update status of the referencing content. - class ImportDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for the input config for ImportDocuments method. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Document>] - # Required. A list of documents to update/create. Each document must have a - # valid {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id}. - # Recommended max of 100 items. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Indicates how imported documents are reconciled with the existing documents - # created or imported before. - module 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 - end - end - - # Response of the - # {::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest 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. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # Echoes the destination for the complete errors in the request if set. - class ImportDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries CompletionService.ImportSuggestionDenyListEntries} - # method. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource] - # The Inline source for the input content for suggestion deny list entries. - # - # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] - # Cloud Storage location for the input content. - # - # Only 1 file can be specified that contains all entries to import. - # Supported values `gcs_source.schema` for autocomplete suggestion deny - # list entry imports: - # - # * `suggestion_deny_list` (default): One JSON [SuggestionDenyListEntry] - # per line. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - class ImportSuggestionDenyListEntriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for SuggestionDenyListEntry. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SuggestionDenyListEntry>] - # Required. A list of all denylist entries to import. Max of 1000 items. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries CompletionService.ImportSuggestionDenyListEntries} - # method. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] imported_entries_count - # @return [::Integer] - # Count of deny list entries successfully imported. - # @!attribute [rw] failed_entries_count - # @return [::Integer] - # Count of deny list entries that failed to be imported. - class ImportSuggestionDenyListEntriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the ImportSuggestionDenyListEntries - # operation. This is returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class ImportSuggestionDenyListEntriesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions CompletionService.ImportCompletionSuggestions} - # method. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource] - # The Inline source for suggestion entries. - # - # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] - # Cloud Storage location for the input content. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bigquery_source - # @return [::Google::Cloud::DiscoveryEngine::V1::BigQuerySource] - # BigQuery input source. - # - # Note: The following fields are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name for which to import customer - # autocomplete suggestions. - # - # Follows pattern `projects/*/locations/*/collections/*/dataStores/*` - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # The desired location of errors incurred during the Import. - class ImportCompletionSuggestionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for CompletionSuggestions. - # @!attribute [rw] suggestions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion>] - # Required. A list of all denylist entries to import. Max of 1000 items. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response of the - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions CompletionService.ImportCompletionSuggestions} - # method. If the long running operation is done, this message is returned by - # the google.longrunning.Operations.response field if the operation is - # successful. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # The desired location of errors incurred during the Import. - class ImportCompletionSuggestionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the ImportCompletionSuggestions - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # successfully imported. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of - # {::Google::Cloud::DiscoveryEngine::V1::CompletionSuggestion CompletionSuggestion}s - # that failed to be imported. - class ImportCompletionSuggestionsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb deleted file mode 100644 index 21030dace2a2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Metadata and configurations for a Google Cloud project in the service. - # @!attribute [r] name - # @return [::String] - # Output only. Full resource name of the project, for example - # `projects/{project}`. - # Note that when making requests, project number and project id are both - # acceptable, but the server will always respond in project number. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this project is created. - # @!attribute [r] provision_completion_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this project is successfully provisioned. - # Empty value means this project is still provisioning and is not ready for - # use. - # @!attribute [r] service_terms_map - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms}] - # Output only. A map of terms of services. The key is the `id` of - # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms ServiceTerms}. - class Project - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata about the terms of service. - # @!attribute [rw] id - # @return [::String] - # The unique identifier of this terms of service. - # Available terms: - # - # * `GA_DATA_USE_TERMS`: [Terms for data - # use](https://cloud.google.com/retail/data-use-terms). When using this as - # `id`, the acceptable - # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms#version version} - # to provide is `2022-11-23`. - # @!attribute [rw] version - # @return [::String] - # The version string of the terms of service. - # For acceptable values, see the comments for - # {::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms#id id} above. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms::State] - # Whether the project has accepted/rejected the service terms or it is - # still pending. - # @!attribute [rw] accept_time - # @return [::Google::Protobuf::Timestamp] - # The last time when the project agreed to the terms of service. - # @!attribute [rw] decline_time - # @return [::Google::Protobuf::Timestamp] - # The last time when the project declined or revoked the agreement to terms - # of service. - class ServiceTerms - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The agreement states this terms of service. - module State - # The default value of the enum. This value is not actually used. - STATE_UNSPECIFIED = 0 - - # The project has given consent to the terms of service. - TERMS_ACCEPTED = 1 - - # The project is pending to review and accept the terms of service. - TERMS_PENDING = 2 - - # The project has declined or revoked the agreement to terms of service. - TERMS_DECLINED = 3 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::Project::ServiceTerms] - class ServiceTermsMapEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb deleted file mode 100644 index a7e5c844df1b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request for - # {::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project ProjectService.ProvisionProject} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::Project Project}, such as - # `projects/{project_id_or_number}`. - # @!attribute [rw] accept_data_use_terms - # @return [::Boolean] - # Required. Set to `true` to specify that caller has read and would like to - # give consent to the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms). - # @!attribute [rw] data_use_terms_version - # @return [::String] - # Required. The version of the [Terms for data - # use](https://cloud.google.com/retail/data-use-terms) that caller has read - # and would like to give consent to. - # - # Acceptable version is `2022-11-23`, and this may change over time. - class ProvisionProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata associated with a project provision operation. - class ProvisionProjectMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb deleted file mode 100644 index 63bffde4f59e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +++ /dev/null @@ -1,293 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for PurgeUserEvents method. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the catalog under which the events are - # created. The format is - # `projects/{project}/locations/global/collections/{collection}/dataStores/{dataStore}`. - # @!attribute [rw] filter - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type 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. - # - # Note: This API only supports purging a max range of 30 days. - # - # Examples: - # - # * Deleting all events in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z"` - # * Deleting specific eventType in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" eventType = "search"` - # * Deleting all events for a specific visitor in a time range: - # `eventTime > "2012-04-23T18:25:43.511Z" - # eventTime < "2012-04-23T18:30:43.511Z" userPseudoId = "visitor1024"` - # * Deleting the past 30 days of events inside a DataStore: - # `*` - # - # The filtering fields are assumed to have an implicit AND. - # @!attribute [rw] force - # @return [::Boolean] - # 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. - class PurgeUserEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of the PurgeUserEventsRequest. If the long running operation is - # successfully done, then this message is returned by the - # google.longrunning.Operations.response field. - # @!attribute [rw] purge_count - # @return [::Integer] - # The total count of events purged as a result of the operation. - class PurgeUserEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeUserEvents operation. - # This will be returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were deleted successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - class PurgeUserEventsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of destination for Purge related errors. - # @!attribute [rw] gcs_prefix - # @return [::String] - # Cloud Storage prefix for purge errors. This must be an empty, - # existing Cloud Storage directory. Purge errors are written to - # sharded files in this directory, one per line, as a JSON-encoded - # `google.rpc.Status` message. - class PurgeErrorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} - # method. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::DiscoveryEngine::V1::GcsSource] - # Cloud Storage location for the input content. - # Supported `data_schema`: - # * `document_id`: One valid - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} per line. - # - # Note: The following fields are mutually exclusive: `gcs_source`, `inline_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource] - # Inline source for the input content for purge. - # - # Note: The following fields are mutually exclusive: `inline_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. - # @!attribute [rw] filter - # @return [::String] - # Required. Filter matching documents to purge. Only currently supported - # value is - # `*` (all items). - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig] - # The desired location of errors incurred during the purge. - # @!attribute [rw] force - # @return [::Boolean] - # Actually performs the purge. If `force` is set to false, return the - # expected purge count without deleting any documents. - class PurgeDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for the input config for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} - # method. - # @!attribute [rw] documents - # @return [::Array<::String>] - # Required. A list of full resource name of documents to purge. In the - # format - # `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. - # Recommended max of 100 items. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents DocumentService.PurgeDocuments} - # method. If the long running operation is successfully done, then this message - # is returned by the google.longrunning.Operations.response field. - # @!attribute [rw] purge_count - # @return [::Integer] - # The total count of documents purged as a result of the operation. - # @!attribute [rw] purge_sample - # @return [::Array<::String>] - # 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. - class PurgeDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeDocuments operation. - # This will be returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of entries that were deleted successfully. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of entries that encountered errors while processing. - # @!attribute [rw] ignored_count - # @return [::Integer] - # Count of entries that were ignored as entries were not found. - class PurgeDocumentsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries CompletionService.PurgeSuggestionDenyListEntries} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name for which to import denylist - # entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*. - class PurgeSuggestionDenyListEntriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries CompletionService.PurgeSuggestionDenyListEntries} - # method. - # @!attribute [rw] purge_count - # @return [::Integer] - # Number of suggestion deny list entries purged. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - class PurgeSuggestionDenyListEntriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeSuggestionDenyListEntries - # operation. This is returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class PurgeSuggestionDenyListEntriesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions CompletionService.PurgeCompletionSuggestions} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name for which to purge completion - # suggestions. Follows pattern - # projects/*/locations/*/collections/*/dataStores/*. - class PurgeCompletionSuggestionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions CompletionService.PurgeCompletionSuggestions} - # method. - # @!attribute [rw] purge_succeeded - # @return [::Boolean] - # Whether the completion suggestions were successfully purged. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - class PurgeCompletionSuggestionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the PurgeCompletionSuggestions - # operation. This is returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class PurgeCompletionSuggestionsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb deleted file mode 100644 index c3812f5907f6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Record message for - # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. - # @!attribute [rw] id - # @return [::String] - # The unique ID to represent the record. - # @!attribute [rw] title - # @return [::String] - # The title of the record. Empty by default. - # At least one of - # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#title title} or - # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#content content} should be - # set otherwise an INVALID_ARGUMENT error is thrown. - # @!attribute [rw] content - # @return [::String] - # The content of the record. Empty by default. - # At least one of - # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#title title} or - # {::Google::Cloud::DiscoveryEngine::V1::RankingRecord#content content} should be - # set otherwise an INVALID_ARGUMENT error is thrown. - # @!attribute [rw] score - # @return [::Float] - # The score of this record based on the given query and selected model. - # The score will be rounded to 2 decimal places. If the score is close to 0, - # it will be rounded to 0.0001 to avoid returning unset. - class RankingRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. - # @!attribute [rw] ranking_config - # @return [::String] - # Required. The resource name of the rank service config, such as - # `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`. - # @!attribute [rw] model - # @return [::String] - # The identifier of the model to use. It is one of: - # - # * `semantic-ranker-512@latest`: Semantic ranking model with maximum input - # token size 512. - # - # It is set to `semantic-ranker-512@latest` by default if unspecified. - # @!attribute [rw] top_n - # @return [::Integer] - # The number of results to return. If this is unset or no bigger than zero, - # returns all results. - # @!attribute [rw] query - # @return [::String] - # The query to use. - # @!attribute [rw] records - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord>] - # Required. A list of records to rank. At most 200 records to rank. - # @!attribute [rw] ignore_record_details_in_response - # @return [::Boolean] - # If true, the response will contain only record ID and score. By default, it - # is false, the response will contain record details. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - class RankRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank RankService.Rank} method. - # @!attribute [rw] records - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RankingRecord>] - # A list of records sorted by descending score. - class RankResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb deleted file mode 100644 index 9b19adfd8a30..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +++ /dev/null @@ -1,230 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for Recommend method. - # @!attribute [rw] serving_config - # @return [::String] - # Required. Full resource name of a - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}: - # `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or - # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` - # - # One default serving config is created along with your recommendation engine - # creation. The engine ID is used as the ID of the default serving - # config. For example, for Engine - # `projects/*/locations/global/collections/*/engines/my-engine`, you can use - # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` - # for your - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend} - # requests. - # @!attribute [rw] user_event - # @return [::Google::Cloud::DiscoveryEngine::V1::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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # or - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # to a random unique ID and leave - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_id UserEvent.user_info.user_id} - # unset. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of results to return. Set this property - # to the number of recommendation results needed. If zero, the service - # chooses a reasonable default. The maximum allowed value is 100. Values - # above 100 are set to 100. - # @!attribute [rw] filter - # @return [::String] - # 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: - # - # * (language: ANY("en", "es")) AND NOT (categories: ANY("Movie")) - # * (available: true) AND - # (language: ANY("en", "es")) OR (categories: ANY("Movie")) - # - # If your filter blocks all results, the API returns generic - # (unfiltered) popular Documents. If you only want results strictly matching - # the filters, set `strictFiltering` to `true` in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params} - # to receive empty results instead. - # - # Note that the API never returns - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s with `storageStatus` - # as `EXPIRED` or `DELETED` regardless of filter choices. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Use validate only mode for this recommendation query. If set to `true`, a - # fake model is 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. - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional domain specific parameters for the recommendations. - # - # Allowed values: - # - # * `returnDocument`: Boolean. If set to `true`, the associated Document - # object is returned in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}. - # * `returnScore`: Boolean. If set to true, the recommendation score - # corresponding to each returned Document is set in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult#metadata 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 - # returns 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. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - class RecommendRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for Recommend method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecommendResponse::RecommendationResult>] - # A list of recommended Documents. The order represents the ranking (from the - # most relevant Document to the least). - # @!attribute [rw] attribution_token - # @return [::String] - # A unique attribution token. This should be included in the - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from - # this recommendation, which enables accurate attribution of recommendation - # model performance. - # @!attribute [rw] missing_ids - # @return [::Array<::String>] - # IDs of documents in the request that were missing from the default Branch - # associated with the requested ServingConfig. - # @!attribute [rw] validate_only - # @return [::Boolean] - # True if - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#validate_only RecommendRequest.validate_only} - # was set. - class RecommendResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # RecommendationResult represents a generic recommendation result with - # associated metadata. - # @!attribute [rw] id - # @return [::String] - # Resource ID of the recommended Document. - # @!attribute [rw] document - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # Set if `returnDocument` is set to true in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params}. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Additional Document metadata or annotations. - # - # Possible values: - # - # * `score`: Recommendation score in double value. Is set if - # `returnScore` is set to true in - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#params RecommendRequest.params}. - class RecommendationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb deleted file mode 100644 index 7744d0519170..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/safety.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Safety rating corresponding to the generated content. - # @!attribute [r] category - # @return [::Google::Cloud::DiscoveryEngine::V1::HarmCategory] - # Output only. Harm category. - # @!attribute [r] probability - # @return [::Google::Cloud::DiscoveryEngine::V1::SafetyRating::HarmProbability] - # Output only. Harm probability levels in the content. - # @!attribute [r] probability_score - # @return [::Float] - # Output only. Harm probability score. - # @!attribute [r] severity - # @return [::Google::Cloud::DiscoveryEngine::V1::SafetyRating::HarmSeverity] - # Output only. Harm severity levels in the content. - # @!attribute [r] severity_score - # @return [::Float] - # Output only. Harm severity score. - # @!attribute [r] blocked - # @return [::Boolean] - # Output only. Indicates whether the content was filtered out because of this - # rating. - class SafetyRating - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Harm probability levels in the content. - module HarmProbability - # Harm probability unspecified. - HARM_PROBABILITY_UNSPECIFIED = 0 - - # Negligible level of harm. - NEGLIGIBLE = 1 - - # Low level of harm. - LOW = 2 - - # Medium level of harm. - MEDIUM = 3 - - # High level of harm. - HIGH = 4 - end - - # Harm severity levels. - module HarmSeverity - # Harm severity unspecified. - HARM_SEVERITY_UNSPECIFIED = 0 - - # Negligible level of harm severity. - HARM_SEVERITY_NEGLIGIBLE = 1 - - # Low level of harm severity. - HARM_SEVERITY_LOW = 2 - - # Medium level of harm severity. - HARM_SEVERITY_MEDIUM = 3 - - # High level of harm severity. - HARM_SEVERITY_HIGH = 4 - end - end - - # Harm categories that will block the content. - module HarmCategory - # The harm category is unspecified. - HARM_CATEGORY_UNSPECIFIED = 0 - - # The harm category is hate speech. - HARM_CATEGORY_HATE_SPEECH = 1 - - # The harm category is dangerous content. - HARM_CATEGORY_DANGEROUS_CONTENT = 2 - - # The harm category is harassment. - HARM_CATEGORY_HARASSMENT = 3 - - # The harm category is sexually explicit content. - HARM_CATEGORY_SEXUALLY_EXPLICIT = 4 - - # The harm category is civic integrity. - HARM_CATEGORY_CIVIC_INTEGRITY = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb deleted file mode 100644 index dbf9c28816ec..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Defines the structure and layout of a type of document data. - # @!attribute [rw] struct_schema - # @return [::Google::Protobuf::Struct] - # The structured representation of the schema. - # - # Note: The following fields are mutually exclusive: `struct_schema`, `json_schema`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] json_schema - # @return [::String] - # The JSON representation of the schema. - # - # Note: The following fields are mutually exclusive: `json_schema`, `struct_schema`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # 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. - class Schema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb deleted file mode 100644 index c5b05e63a03d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +++ /dev/null @@ -1,177 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema SchemaService.GetSchema} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - class GetSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s to - # return. The service may return fewer than this value. - # - # If unspecified, at most 100 - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s are returned. - # - # The maximum value is 1000; values above 1000 are set to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # must match the call that provided the page token. - class ListSchemasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas SchemaService.ListSchemas} - # method. - # @!attribute [rw] schemas - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Schema>] - # The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest#page_token ListSchemasRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - class ListSchemasResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema SchemaService.CreateSchema} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent data store resource name, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # @!attribute [rw] schema - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to create. - # @!attribute [rw] schema_id - # @return [::String] - # Required. The ID to use for the - # {::Google::Cloud::DiscoveryEngine::V1::Schema Schema}, which becomes the final - # component of the - # {::Google::Cloud::DiscoveryEngine::V1::Schema#name Schema.name}. - # - # This field should conform to - # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length - # limit of 63 characters. - class CreateSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema SchemaService.UpdateSchema} - # method. - # @!attribute [rw] schema - # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} to update. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If set to true, and the {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # not found, a new {::Google::Cloud::DiscoveryEngine::V1::Schema Schema} is - # created. In this situation, `update_mask` is ignored. - class UpdateSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema SchemaService.DeleteSchema} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. The full resource name of the schema, in the format of - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. - class DeleteSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for Create Schema LRO. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class CreateSchemaMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for UpdateSchema LRO. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class UpdateSchemaMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for DeleteSchema LRO. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteSchemaMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb deleted file mode 100644 index 8c03501e65d4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +++ /dev/null @@ -1,1946 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # method. - # @!attribute [rw] serving_config - # @return [::String] - # Required. The resource name of the Search serving config, such as - # `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, - # or - # `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. - # @!attribute [rw] branch - # @return [::String] - # 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. - # @!attribute [rw] query - # @return [::String] - # Raw search query. - # @!attribute [rw] page_categories - # @return [::Array<::String>] - # Optional. The categories associated with a category page. Must be set for - # category navigation queries to achieve good search quality. The format - # should be the same as - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category}. - # This field is the equivalent of the query for browse (navigation) queries. - # It's used by the browse model when the query is empty. - # - # If the field is empty, it will not be used by the browse model. - # If the field contains more than one element, only the first element will - # be used. - # - # To represent full path of a category, use '>' character to separate - # different hierarchies. If '>' is part of the category name, replace it with - # other character(s). - # For example, `Graphics Cards > RTX>4090 > Founders Edition` where "RTX > - # 4090" represents one level, can be rewritten as `Graphics Cards > RTX_4090 - # > Founders Edition` - # @!attribute [rw] image_query - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery] - # Raw image query. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s to - # return. The maximum allowed value depends on the data type. Values above - # the maximum value are coerced to the maximum value. - # - # * Websites with basic indexing: Default `10`, Maximum `25`. - # * Websites with advanced indexing: Default `25`, Maximum `50`. - # * Other: Default `50`, Maximum `100`. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token received from a previous - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # must match the call that provided the page token. Otherwise, an - # `INVALID_ARGUMENT` error is returned. - # @!attribute [rw] offset - # @return [::Integer] - # A 0-indexed integer that specifies the current offset (that is, starting - # result location, amongst the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document}s deemed by the API as - # relevant) in search results. This field is only considered if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token page_token} is - # unset. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # - # A large offset may be capped to a reasonable threshold. - # @!attribute [rw] one_box_page_size - # @return [::Integer] - # The maximum number of results to return for OneBox. - # This applies to each OneBox type individually. - # Default number is 10. - # @!attribute [rw] data_store_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>] - # Specifications that define the specific - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s to be searched, - # along with configurations for those data stores. This is only considered - # for {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s with multiple data - # stores. For engines with a single data store, the specs directly under - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} should be - # used. - # @!attribute [rw] filter - # @return [::String] - # 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. - # - # Filtering in Vertex AI Search is done by mapping the LHS filter key to a - # key property defined in the Vertex AI Search backend -- this mapping is - # defined by the customer in their schema. For example a media customer might - # have a field 'name' in their schema. In this case the filter would look - # like this: filter --> name:'ANY("king kong")' - # - # For more information about filtering including syntax and filter - # operators, see - # [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @!attribute [rw] canonical_filter - # @return [::String] - # The default filter that is applied when a user performs a search without - # checking any filters on the search page. - # - # The filter applied to every search request when quality improvement such as - # query expansion is needed. In the case a query does not have a sufficient - # amount of results this filter will be used to determine whether or not to - # enable the query expansion flow. The original filter will still be used for - # the query expanded search. - # This field is strongly recommended to achieve high search quality. - # - # For more information about filter syntax, see - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter}. - # @!attribute [rw] order_by - # @return [::String] - # The order in which documents are returned. Documents can be ordered by - # a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. - # Leave it unset if ordered by relevance. `order_by` expression is - # case-sensitive. - # - # For more information on ordering the website search results, see - # [Order web search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). - # For more information on ordering the healthcare search results, see - # [Order healthcare search - # results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). - # If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. - # @!attribute [rw] user_info - # @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo] - # Information about the end user. - # Highly recommended for analytics and personalization. - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserInfo.user_agent} - # is used to deduce `device_type` for analytics. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see [Standard - # fields](https://cloud.google.com/apis/design/standard_fields). This field - # helps to better interpret the query. If a value isn't specified, the query - # language code is automatically detected, which may not be accurate. - # @!attribute [rw] facet_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec>] - # 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. - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] - # Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @!attribute [rw] params - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # 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. - # For example, `user_country_code: "au"` - # - # For available codes see [Country - # Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) - # - # * `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. - # For example, `search_type: 1` - # @!attribute [rw] query_expansion_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec] - # The query expansion specification that specifies the conditions under which - # query expansion occurs. - # @!attribute [rw] spell_correction_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec] - # The spell correction specification that specifies the mode under - # which spell correction takes effect. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # Optional. 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # and - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest#user_pseudo_id 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. - # @!attribute [rw] content_search_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec] - # A specification for configuring the behavior of content search. - # @!attribute [rw] ranking_expression - # @return [::String] - # Optional. The ranking expression controls the customized ranking on - # retrieval documents. This overrides - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#ranking_expression ServingConfig.ranking_expression}. - # The syntax and supported features depend on the - # `ranking_expression_backend` value. If `ranking_expression_backend` is not - # provided, it defaults to `RANK_BY_EMBEDDING`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is not provided or set to `RANK_BY_EMBEDDING`, it should be a single - # function or multiple functions that are joined 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)`. - # - # If - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#ranking_expression_backend ranking_expression_backend} - # is set to `RANK_BY_FORMULA`, the following expression types (and - # combinations of those chained using + or - # * operators) are supported: - # - # * `double` - # * `signal` - # * `log(signal)` - # * `exp(signal)` - # * `rr(signal, double > 0)` -- reciprocal rank transformation with second - # argument being a denominator constant. - # * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. - # * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns - # signal2 | double, else returns signal1. - # - # Here are a few examples of ranking formulas that use the supported - # ranking expression types: - # - # - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` - # -- mostly rank by the logarithm of `keyword_similarity_score` with slight - # `semantic_smilarity_score` adjustment. - # - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * - # is_nan(keyword_similarity_score)` -- rank by the exponent of - # `semantic_similarity_score` filling the value with 0 if it's NaN, also - # add constant 0.3 adjustment to the final score if - # `semantic_similarity_score` is NaN. - # - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * - # rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank - # of `keyword_similarity_score` with slight adjustment of reciprocal rank - # of `semantic_smilarity_score`. - # - # The following signals are supported: - # - # * `semantic_similarity_score`: semantic similarity adjustment that is - # calculated using the embeddings generated by a proprietary Google model. - # This score determines how semantically similar a search query is to a - # document. - # * `keyword_similarity_score`: keyword match adjustment uses the Best - # Match 25 (BM25) ranking function. This score is calculated using a - # probabilistic model to estimate the probability that a document is - # relevant to a given query. - # * `relevance_score`: semantic relevance adjustment that uses a - # proprietary Google model to determine the meaning and intent behind a - # user's query in context with the content in the documents. - # * `pctr_rank`: predicted conversion rate adjustment as a rank use - # predicted Click-through rate (pCTR) to gauge the relevance and - # attractiveness of a search result from a user's perspective. A higher - # pCTR suggests that the result is more likely to satisfy the user's query - # and intent, making it a valuable signal for ranking. - # * `freshness_rank`: freshness adjustment as a rank - # * `document_age`: The time in hours elapsed since the document was last - # updated, a floating-point number (e.g., 0.25 means 15 minutes). - # * `topicality_rank`: topicality adjustment as a rank. Uses proprietary - # Google model to determine the keyword-based overlap between the query and - # the document. - # * `base_rank`: the default rank of the result - # @!attribute [rw] ranking_expression_backend - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RankingExpressionBackend] - # Optional. The backend to use for the ranking expression evaluation. - # @!attribute [rw] safe_search - # @return [::Boolean] - # Whether to turn on safe search. This is only supported for - # website search. - # @!attribute [rw] user_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # 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. - # @!attribute [rw] natural_language_query_understanding_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec] - # Optional. Config for natural language query understanding capabilities, - # such as extracting structured field filters from the query. Refer to [this - # documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) - # for more information. - # If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional - # natural language query understanding will be done. - # @!attribute [rw] search_as_you_type_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec] - # Search as you type configuration. Only supported for the - # {::Google::Cloud::DiscoveryEngine::V1::IndustryVertical::MEDIA IndustryVertical.MEDIA} - # vertical. - # @!attribute [rw] display_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec] - # Optional. Config for display feature, like match highlighting on search - # results. - # @!attribute [rw] crowding_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec>] - # Optional. Crowding specifications for improving result diversity. - # If multiple CrowdingSpecs are specified, crowding will be evaluated on - # each unique combination of the `field` values, and max_count will be the - # maximum value of `max_count` across all CrowdingSpecs. - # For example, if the first CrowdingSpec has `field` = "color" and - # `max_count` = 3, and the second CrowdingSpec has `field` = "size" and - # `max_count` = 2, then after 3 documents that share the same color AND size - # have been returned, subsequent ones should be - # removed or demoted. - # @!attribute [rw] session - # @return [::String] - # The session resource name. Optional. - # - # Session allows users to do multi-turn /search API calls or coordination - # between /search API calls and /answer API calls. - # - # Example #1 (multi-turn /search API calls): - # Call /search API with the session ID generated in the first call. - # Here, the previous search query gets considered in query - # standing. I.e., if the first query is "How did Alphabet do in 2022?" - # and the current query is "How about 2023?", the current query will - # be interpreted as "How did Alphabet do in 2023?". - # - # Example #2 (coordination between /search API calls and /answer API calls): - # Call /answer API with the session ID generated in the first call. - # Here, the answer generation happens in the context of the search - # results from the first search call. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @!attribute [rw] session_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec] - # Session specification. - # - # Can be used only when `session` is set. - # @!attribute [rw] relevance_threshold - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceThreshold] - # The global relevance threshold of the search results. - # - # Defaults to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # If more granular relevance filtering is required, use the - # `relevance_filter_spec` instead. - # - # This feature is not supported for healthcare search. - # @!attribute [rw] relevance_score_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec] - # Optional. The specification for returning the relevance score. - class SearchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies the image query input. - # @!attribute [rw] image_bytes - # @return [::String] - # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and - # BMP. - class ImageQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A struct to define data stores to filter on in a search call and - # configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` - # error is returned. - # @!attribute [rw] data_store - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # The path must include the project number, project id is not supported for - # this field. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter specification to filter documents in the data store - # specified by data_store field. For more information on filtering, see - # [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) - # @!attribute [rw] boost_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec] - # Optional. Boost specification to boost certain documents. - # For more information on boosting, see - # [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results) - # @!attribute [rw] custom_search_operators - # @return [::String] - # Optional. Custom search operators which if specified will be used to - # filter results from workspace data stores. For more information on custom - # search operators, see - # [SearchOperators](https://support.google.com/cloudsearch/answer/6172299). - class DataStoreSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A facet specification to perform faceted search. - # @!attribute [rw] facet_key - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey] - # Required. The facet key specification. - # @!attribute [rw] limit - # @return [::Integer] - # Maximum facet values that are returned for this facet. If - # unspecified, defaults to 20. The maximum allowed value is 300. Values - # above 300 are coerced to 300. - # For aggregation in healthcare search, when the [FacetKey.key] is - # "healthcare_aggregation_key", the limit will be overridden to - # 10,000 internally, regardless of the value set here. - # - # If this field is negative, an `INVALID_ARGUMENT` is returned. - # @!attribute [rw] excluded_filter_keys - # @return [::Array<::String>] - # List of keys to exclude when faceting. - # - # By default, - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key 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 - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key 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. - # @!attribute [rw] enable_dynamic_position - # @return [::Boolean] - # 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. - class FacetSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies how a facet is computed. - # @!attribute [rw] key - # @return [::String] - # Required. Supported textual and numerical facet keys in - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object, over which - # the facet values are computed. Facet key is case-sensitive. - # @!attribute [rw] intervals - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Interval>] - # 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. - # @!attribute [rw] restricted_values - # @return [::Array<::String>] - # 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. - # @!attribute [rw] prefixes - # @return [::Array<::String>] - # 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. - # @!attribute [rw] contains - # @return [::Array<::String>] - # Only get facet values that contain 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. - # @!attribute [rw] case_insensitive - # @return [::Boolean] - # True to make facet keys case insensitive when getting faceting - # values with prefixes or contains; false otherwise. - # @!attribute [rw] order_by - # @return [::String] - # The order in which documents are returned. - # - # Allowed values are: - # - # * "count desc", which means order by - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#count SearchResponse.Facet.values.count} - # descending. - # - # * "value desc", which means order by - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue#value SearchResponse.Facet.values.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 - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals FacetSpec.FacetKey.intervals}. - class FacetKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Boost specification to boost certain documents. - # @!attribute [rw] condition_boost_specs - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec>] - # Condition boost specifications. If a document matches multiple conditions - # in the specifications, boost scores from these specifications are all - # applied and combined in a non-linear way. Maximum number of - # specifications is 20. - class BoostSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Boost applies to documents which match a condition. - # @!attribute [rw] condition - # @return [::String] - # An expression which specifies a boost condition. The syntax and - # supported fields are the same as a filter expression. See - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter} - # for detail syntax and limitations. - # - # Examples: - # - # * To boost documents with document ID "doc_1" or "doc_2", and - # color "Red" or "Blue": - # `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))` - # @!attribute [rw] boost - # @return [::Float] - # 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. Only one of the (condition, boost) combination or the - # boost_control_spec below are set. If both are set then the global boost - # is ignored and the more fine-grained boost_control_spec is applied. - # @!attribute [rw] boost_control_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec] - # Complex specification for custom ranking based on customer defined - # attribute value. - class ConditionBoostSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specification for custom ranking based on customer specified attribute - # value. It provides more controls for customized ranking than the simple - # (condition, boost) combination above. - # @!attribute [rw] field_name - # @return [::String] - # The name of the field whose value will be used to determine the - # boost amount. - # @!attribute [rw] attribute_type - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType] - # The attribute type to be used to determine the boost amount. The - # attribute value can be derived from the field value of the specified - # field_name. In the case of numerical it is straightforward i.e. - # attribute_value = numerical_field_value. In the case of freshness - # however, attribute_value = (time.now() - datetime_field_value). - # @!attribute [rw] interpolation_type - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType] - # The interpolation type to be applied to connect the control points - # listed below. - # @!attribute [rw] control_points - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint>] - # The control points used to define the curve. The monotonic function - # (defined through the interpolation_type above) passes through the - # control points listed here. - class BoostControlSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The control points used to define the curve. The curve defined - # through these control points can only be monotonically increasing - # or decreasing(constant values are acceptable). - # @!attribute [rw] attribute_value - # @return [::String] - # Can be one of: - # 1. The numerical field value. - # 2. The duration spec for freshness: - # The value must be formatted as an XSD `dayTimeDuration` value (a - # restricted subset of an ISO 8601 duration value). The pattern for - # this is: `[nD][T[nH][nM][nS]]`. - # @!attribute [rw] boost_amount - # @return [::Float] - # The value between -1 to 1 by which to boost the score if the - # attribute_value evaluates to the value specified above. - class ControlPoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The attribute(or function) for which the custom ranking is to be - # applied. - module AttributeType - # Unspecified AttributeType. - ATTRIBUTE_TYPE_UNSPECIFIED = 0 - - # The value of the numerical field will be used to dynamically update - # the boost amount. In this case, the attribute_value (the x value) - # of the control point will be the actual value of the numerical - # field for which the boost_amount is specified. - NUMERICAL = 1 - - # For the freshness use case the attribute value will be the duration - # between the current time and the date in the datetime field - # specified. The value must be formatted as an XSD `dayTimeDuration` - # value (a restricted subset of an ISO 8601 duration value). The - # pattern for this is: `[nD][T[nH][nM][nS]]`. - # For example, `5D`, `3DT12H30M`, `T24H`. - FRESHNESS = 2 - end - - # The interpolation type to be applied. Default will be linear - # (Piecewise Linear). - module InterpolationType - # Interpolation type is unspecified. In this case, it defaults to - # Linear. - INTERPOLATION_TYPE_UNSPECIFIED = 0 - - # Piecewise linear interpolation will be applied. - LINEAR = 1 - end - end - end - end - - # Specification to determine under which conditions query expansion should - # occur. - # @!attribute [rw] condition - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition] - # The condition under which query expansion should occur. Default to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. - # @!attribute [rw] pin_unexpanded_results - # @return [::Boolean] - # 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. - class QueryExpansionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which condition query expansion should occur. - module Condition - # Unspecified query expansion condition. In this case, server behavior - # defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec::Condition::DISABLED Condition.DISABLED}. - CONDITION_UNSPECIFIED = 0 - - # Disabled query expansion. Only the exact search query is used, even if - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size SearchResponse.total_size} - # is zero. - DISABLED = 1 - - # Automatic query expansion built by the Search API. - AUTO = 2 - end - end - - # The specification for query spell correction. - # @!attribute [rw] mode - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode] - # The mode under which spell correction - # replaces the original search query. Defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. - class SpellCorrectionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which mode spell correction should occur. - module Mode - # Unspecified spell correction mode. In this case, server behavior - # defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec::Mode::AUTO Mode.AUTO}. - MODE_UNSPECIFIED = 0 - - # Search API tries to find a spelling suggestion. If a suggestion is - # found, it is put in the - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#corrected_query SearchResponse.corrected_query}. - # The spelling suggestion won't 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 - end - end - - # A specification for configuring the behavior of content search. - # @!attribute [rw] snippet_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SnippetSpec] - # If `snippetSpec` is not specified, snippets are not included in the - # search response. - # @!attribute [rw] summary_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec] - # If `summarySpec` is not specified, summaries are not included in the - # search response. - # @!attribute [rw] extractive_content_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ExtractiveContentSpec] - # If there is no extractive_content_spec provided, there will be no - # extractive answer in the search response. - # @!attribute [rw] search_result_mode - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode] - # Specifies the search result mode. If unspecified, the - # search result mode defaults to `DOCUMENTS`. - # @!attribute [rw] chunk_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::ChunkSpec] - # Specifies the chunk spec to be returned from the search response. - # Only available if the - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} - # is set to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS} - class ContentSearchSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A specification for configuring snippets in a search response. - # @!attribute [rw] max_snippet_count - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # [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. - # @!attribute [rw] reference_only - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # [DEPRECATED] This field is deprecated and will have no affect on the - # snippet. - # @!attribute [rw] return_snippet - # @return [::Boolean] - # 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. - class SnippetSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A specification for configuring a summary returned in a search - # response. - # @!attribute [rw] summary_result_count - # @return [::Integer] - # 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 10 results for documents mode, or 50 for chunks mode, can be - # used to generate a summary. The chunks mode is used when - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} - # is set to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}. - # @!attribute [rw] include_citations - # @return [::Boolean] - # 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. - # @!attribute [rw] ignore_adversarial_query - # @return [::Boolean] - # 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. - # @!attribute [rw] ignore_non_summary_seeking_query - # @return [::Boolean] - # 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. - # @!attribute [rw] ignore_low_relevant_content - # @return [::Boolean] - # Specifies whether to filter out queries that have low relevance. The - # default value is `false`. - # - # If this field is set to `false`, all search results are used regardless - # of relevance to generate answers. If set to `true`, only queries with - # high relevance search results will generate answers. - # @!attribute [rw] ignore_jail_breaking_query - # @return [::Boolean] - # Optional. Specifies whether to filter out jail-breaking queries. The - # default value is `false`. - # - # Google employs search-query classification to detect jail-breaking - # queries. No summary is returned if the search query is classified as a - # jail-breaking query. A user might add instructions to the query to - # change the tone, style, language, content of the answer, or ask the - # model to act as a different entity, e.g. "Reply in the tone of a - # competing company's CEO". If this field is set to `true`, we skip - # generating summaries for jail-breaking queries and return fallback - # messages instead. - # @!attribute [rw] model_prompt_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec::ModelPromptSpec] - # If specified, the spec will be used to modify the prompt provided to - # the LLM. - # @!attribute [rw] language_code - # @return [::String] - # 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. - # @!attribute [rw] model_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec::ModelSpec] - # If specified, the spec will be used to modify the model specification - # provided to the LLM. - # @!attribute [rw] use_semantic_chunks - # @return [::Boolean] - # If true, answer will be generated from most relevant chunks from top - # search results. This feature will improve summary quality. - # Note that with this feature enabled, not all top search results - # will be referenced and included in the reference list, so the citation - # source index only points to the search results listed in the reference - # list. - class SummarySpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specification of the prompt to use with the model. - # @!attribute [rw] preamble - # @return [::String] - # Text at the beginning of the prompt that instructs the assistant. - # Examples are available in the user guide. - class ModelPromptSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification of the model. - # @!attribute [rw] version - # @return [::String] - # The model version used to generate the summary. - # - # Supported values are: - # - # * `stable`: string. Default value when no value is specified. Uses a - # generally available, fine-tuned model. For more information, see - # [Answer generation model versions and - # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). - # * `preview`: string. (Public preview) Uses a preview model. For more - # information, see - # [Answer generation model versions and - # lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). - class ModelSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A specification for configuring the extractive content in a search - # response. - # @!attribute [rw] max_extractive_answer_count - # @return [::Integer] - # 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 five answers are returned for each - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult SearchResult}. - # @!attribute [rw] max_extractive_segment_count - # @return [::Integer] - # The max number of extractive segments returned in each search result. - # Only applied if the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} is set to - # {::Google::Cloud::DiscoveryEngine::V1::DataStore::ContentConfig::CONTENT_REQUIRED DataStore.ContentConfig.CONTENT_REQUIRED} - # or - # {::Google::Cloud::DiscoveryEngine::V1::DataStore#solution_types DataStore.solution_types} - # is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_CHAT 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`. - # @!attribute [rw] return_extractive_segment_score - # @return [::Boolean] - # Specifies whether to return the confidence score from the extractive - # segments in each search result. This feature is available only for new - # or allowlisted data stores. To allowlist your data store, - # contact your Customer Engineer. The default value is `false`. - # @!attribute [rw] num_previous_segments - # @return [::Integer] - # Specifies whether to also include the adjacent from each selected - # segments. - # Return at most `num_previous_segments` segments before each selected - # segments. - # @!attribute [rw] num_next_segments - # @return [::Integer] - # Return at most `num_next_segments` segments after each selected - # segments. - class ExtractiveContentSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the chunk spec to be returned from the search response. - # Only available if the - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} - # is set to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS} - # @!attribute [rw] num_previous_chunks - # @return [::Integer] - # The number of previous chunks to be returned of the current chunk. The - # maximum allowed value is 3. - # If not specified, no previous chunks will be returned. - # @!attribute [rw] num_next_chunks - # @return [::Integer] - # The number of next chunks to be returned of the current chunk. The - # maximum allowed value is 3. - # If not specified, no next chunks will be returned. - class ChunkSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the search result mode. If unspecified, the - # search result mode defaults to `DOCUMENTS`. - module SearchResultMode - # Default value. - SEARCH_RESULT_MODE_UNSPECIFIED = 0 - - # Returns documents in the search result. - DOCUMENTS = 1 - - # Returns chunks in the search result. Only available if the - # {::Google::Cloud::DiscoveryEngine::V1::DocumentProcessingConfig#chunking_config DocumentProcessingConfig.chunking_config} - # is specified. - CHUNKS = 2 - end - end - - # Specification to enable natural language understanding capabilities for - # search requests. - # @!attribute [rw] filter_extraction_condition - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition] - # The condition under which filter extraction should occur. - # Server behavior defaults to `DISABLED`. - # @!attribute [rw] geo_search_query_detection_field_names - # @return [::Array<::String>] - # Field names used for location-based filtering, where geolocation filters - # are detected in natural language search queries. - # Only valid when the FilterExtractionCondition is set to `ENABLED`. - # - # If this field is set, it overrides the field names set in - # [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1.ServingConfig.geo_search_query_detection_field_names]. - # @!attribute [rw] extracted_filter_behavior - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::ExtractedFilterBehavior] - # Optional. Controls behavior of how extracted filters are applied to the - # search. The default behavior depends on the request. For single datastore - # structured search, the default is `HARD_FILTER`. For multi-datastore - # search, the default behavior is `SOFT_BOOST`. - # Location-based filters are always applied as hard filters, and the - # `SOFT_BOOST` setting will not affect them. - # This field is only used if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition SearchRequest.NaturalLanguageQueryUnderstandingSpec.FilterExtractionCondition} - # is set to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec::FilterExtractionCondition::ENABLED FilterExtractionCondition.ENABLED}. - # @!attribute [rw] allowed_field_names - # @return [::Array<::String>] - # Optional. Allowlist of fields that can be used for natural language - # filter extraction. By default, if this is unspecified, all indexable - # fields are eligible for natural language filter extraction (but are not - # guaranteed to be used). If any fields are specified in - # allowed_field_names, only the fields that are both marked as indexable in - # the schema and specified in the allowlist will be eligible for natural - # language filter extraction. Note: for multi-datastore search, this is not - # yet supported, and will be ignored. - class NaturalLanguageQueryUnderstandingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which condition filter extraction should occur. - module FilterExtractionCondition - # Server behavior defaults to `DISABLED`. - CONDITION_UNSPECIFIED = 0 - - # Disables NL filter extraction. - DISABLED = 1 - - # Enables NL filter extraction. - ENABLED = 2 - end - - # Enum describing how extracted filters are applied to the search. - module ExtractedFilterBehavior - # `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior - # for extracted filters. For single datastore search, the default is to - # apply as hard filters. For multi-datastore search, the default is to - # apply as soft boosts. - EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0 - - # Applies all extracted filters as hard filters on the results. Results - # that do not pass the extracted filters will not be returned in the - # result set. - HARD_FILTER = 1 - - # Applies all extracted filters as soft boosts. Results that pass the - # filters will be boosted up to higher ranks in the result set. - SOFT_BOOST = 2 - end - end - - # Specification for search as you type in search requests. - # @!attribute [rw] condition - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition] - # The condition under which search as you type should occur. - # Default to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}. - class SearchAsYouTypeSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which condition search as you type should occur. - module Condition - # Server behavior defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec::Condition::DISABLED Condition.DISABLED}. - CONDITION_UNSPECIFIED = 0 - - # Disables Search As You Type. - DISABLED = 1 - - # Enables Search As You Type. - ENABLED = 2 - - # Automatic switching between search-as-you-type and standard search - # modes, ideal for single-API implementations (e.g., debouncing). - AUTO = 3 - end - end - - # Specifies features for display, like match highlighting. - # @!attribute [rw] match_highlighting_condition - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec::MatchHighlightingCondition] - # The condition under which match highlighting should occur. - class DisplaySpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing under which condition match highlighting should occur. - module MatchHighlightingCondition - # Server behavior is the same as `MATCH_HIGHLIGHTING_DISABLED`. - MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED = 0 - - # Disables match highlighting on all documents. - MATCH_HIGHLIGHTING_DISABLED = 1 - - # Enables match highlighting on all documents. - MATCH_HIGHLIGHTING_ENABLED = 2 - end - end - - # Specification for crowding. Crowding improves the diversity of search - # results by limiting the number of results that share the same field value. - # For example, crowding on the color field with a max_count of 3 and mode - # DROP_CROWDED_RESULTS will return at most 3 results with the same color - # across all pages. - # @!attribute [rw] field - # @return [::String] - # The field to use for crowding. Documents can be crowded by a field in the - # {::Google::Cloud::DiscoveryEngine::V1::Document Document} object. Crowding - # field is case sensitive. - # @!attribute [rw] max_count - # @return [::Integer] - # The maximum number of documents to keep per value of the field. Once - # there are at least max_count previous results which contain the same - # value for the given field (according to the order specified in - # `order_by`), later results with the same value are "crowded away". - # If not specified, the default value is 1. - # @!attribute [rw] mode - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode] - # Mode to use for documents that are crowded away. - class CrowdingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum describing the mode to use for documents that are crowded away. - # They can be dropped or demoted to the later pages. - module Mode - # Unspecified crowding mode. In this case, server behavior defaults to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec::Mode::DROP_CROWDED_RESULTS Mode.DROP_CROWDED_RESULTS}. - MODE_UNSPECIFIED = 0 - - # Drop crowded results. - DROP_CROWDED_RESULTS = 1 - - # Demote crowded results to the later pages. - DEMOTE_CROWDED_RESULTS_TO_END = 2 - end - end - - # Session specification. - # - # Multi-turn Search feature is currently at private GA stage. Please use - # v1alpha or v1beta version instead before we launch this feature to public - # GA. Or ask for allowlisting through Google Support team. - # @!attribute [rw] query_id - # @return [::String] - # If set, the search result gets stored to the "turn" specified by this - # query ID. - # - # Example: Let's say the session looks like this: - # session { - # name: ".../sessions/xxx" - # turns { - # query { text: "What is foo?" query_id: ".../questions/yyy" } - # answer: "Foo is ..." - # } - # turns { - # query { text: "How about bar then?" query_id: ".../questions/zzz" } - # } - # } - # - # The user can call /search API with a request like this: - # - # session: ".../sessions/xxx" - # session_spec { query_id: ".../questions/zzz" } - # - # Then, the API stores the search result, associated with the last turn. - # The stored search result can be used by a subsequent /answer API call - # (with the session ID and the query ID specified). Also, it is possible - # to call /search and /answer in parallel with the same session ID & query - # ID. - # @!attribute [rw] search_result_persistence_count - # @return [::Integer] - # The number of top search results to persist. The persisted search results - # can be used for the subsequent /answer api call. - # - # This field is similar to the `summary_result_count` field in - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#summary_result_count SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count}. - # - # At most 10 results for documents mode, or 50 for chunks mode. - class SessionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The specification for returning the document relevance score. - # @!attribute [rw] return_relevance_score - # @return [::Boolean] - # Optional. Whether to return the relevance score for search results. - # The higher the score, the more relevant the document is to the query. - class RelevanceScoreSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class ParamsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The backend to use for the ranking expression evaluation. - module RankingExpressionBackend - # Default option for unspecified/unknown values. - RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0 - - # Deprecated: Use `RANK_BY_EMBEDDING` instead. - # Ranking by custom embedding model, the default way to evaluate the - # ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be - # used instead. - BYOE = 1 - - # Deprecated: Use `RANK_BY_FORMULA` instead. - # Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should - # be used instead. - CLEARBOX = 2 - - # Ranking by custom embedding model, the default way to evaluate the - # ranking expression. - RANK_BY_EMBEDDING = 3 - - # Ranking by custom formula. - RANK_BY_FORMULA = 4 - end - - # The relevance threshold of the search results. The higher relevance - # threshold is, the higher relevant results are shown and the less number of - # results are returned. - module RelevanceThreshold - # Default value. In this case, server behavior defaults to Google defined - # threshold. - RELEVANCE_THRESHOLD_UNSPECIFIED = 0 - - # Lowest relevance threshold. - LOWEST = 1 - - # Low relevance threshold. - LOW = 2 - - # Medium relevance threshold. - MEDIUM = 3 - - # High relevance threshold. - HIGH = 4 - end - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # method. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult>] - # A list of matched documents. The order represents the ranking. - # @!attribute [rw] facets - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet>] - # Results of facets requested by user. - # @!attribute [rw] total_size - # @return [::Integer] - # The estimated total count of matched items irrespective of pagination. The - # count of {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#results results} - # returned by pagination may be less than the - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#total_size total_size} - # that matches. - # @!attribute [rw] attribution_token - # @return [::String] - # A unique search token. This should be included in the - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent UserEvent} logs resulting from - # this search, which enables accurate attribution of search model - # performance. This also helps to identify a request during the customer - # support scenarios. - # @!attribute [rw] redirect_uri - # @return [::String] - # The URI of a customer-defined redirect page. If redirect action is - # triggered, no search is performed, and only - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#redirect_uri redirect_uri} - # and - # {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token attribution_token} - # are set in the response. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#page_token SearchRequest.page_token} - # to retrieve the next page. If this field is omitted, there are no - # subsequent pages. - # @!attribute [rw] corrected_query - # @return [::String] - # 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. - # @!attribute [rw] summary - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary] - # A summary as part of the search results. - # This field is only returned if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#summary_spec SearchRequest.ContentSearchSpec.summary_spec} - # is set. - # @!attribute [rw] query_expansion_info - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::QueryExpansionInfo] - # Query expansion information for the returned results. - # @!attribute [r] natural_language_query_understanding_info - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo] - # Output only. Natural language query understanding information for the - # returned results. - # @!attribute [rw] session_info - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SessionInfo] - # Session information. - # - # Only set if - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session} - # is provided. See its description for more details. - # @!attribute [rw] search_link_promotions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchLinkPromotion>] - # Promotions for site search. - # @!attribute [r] semantic_state - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SemanticState] - # Output only. Indicates the semantic state of the search response. - class SearchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the search results. - # @!attribute [rw] id - # @return [::String] - # {::Google::Cloud::DiscoveryEngine::V1::Document#id Document.id} of the - # searched {::Google::Cloud::DiscoveryEngine::V1::Document Document}. - # @!attribute [rw] document - # @return [::Google::Cloud::DiscoveryEngine::V1::Document] - # The document data snippet in the search response. Only fields that are - # marked as `retrievable` are populated. - # @!attribute [rw] chunk - # @return [::Google::Cloud::DiscoveryEngine::V1::Chunk] - # The chunk data in the search response if the - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec#search_result_mode SearchRequest.ContentSearchSpec.search_result_mode} - # is set to - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode::CHUNKS CHUNKS}. - # @!attribute [r] model_scores - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::DoubleList}] - # Output only. Google provided available scores. - # @!attribute [rw] rank_signals - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals] - # Optional. A set of ranking signals associated with the result. - class SearchResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of ranking signals. - # @!attribute [rw] keyword_similarity_score - # @return [::Float] - # Optional. Keyword matching adjustment. - # @!attribute [rw] relevance_score - # @return [::Float] - # Optional. Semantic relevance adjustment. - # @!attribute [rw] semantic_similarity_score - # @return [::Float] - # Optional. Semantic similarity adjustment. - # @!attribute [rw] pctr_rank - # @return [::Float] - # Optional. Predicted conversion rate adjustment as a rank. - # @!attribute [rw] topicality_rank - # @return [::Float] - # Optional. Topicality adjustment as a rank. - # @!attribute [rw] document_age - # @return [::Float] - # Optional. Age of the document in hours. - # @!attribute [rw] boosting_factor - # @return [::Float] - # Optional. Combined custom boosts for a doc. - # @!attribute [rw] default_rank - # @return [::Float] - # Optional. The default rank of the result. - # @!attribute [rw] custom_signals - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult::RankSignals::CustomSignal>] - # Optional. A list of custom clearbox signals. - class RankSignals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Custom clearbox signal represented by name and value pair. - # @!attribute [rw] name - # @return [::String] - # Optional. Name of the signal. - # @!attribute [rw] value - # @return [::Float] - # Optional. Float value representing the ranking signal (e.g. 1.25 for - # BM25). - class CustomSignal - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::DoubleList] - class ModelScoresEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A facet result. - # @!attribute [rw] key - # @return [::String] - # The key for this facet. For example, `"colors"` or `"price"`. It matches - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#key SearchRequest.FacetSpec.FacetKey.key}. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Facet::FacetValue>] - # The facet values for this field. - # @!attribute [rw] dynamic_facet - # @return [::Boolean] - # Whether the facet is dynamically generated. - class Facet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A facet value which contains value names and their count. - # @!attribute [rw] value - # @return [::String] - # Text value of a facet, such as "Black" for facet "colors". - # - # Note: The following fields are mutually exclusive: `value`, `interval`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] interval - # @return [::Google::Cloud::DiscoveryEngine::V1::Interval] - # Interval value for a facet, such as [10, 20) for facet "price". It - # matches - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec::FacetKey#intervals SearchRequest.FacetSpec.FacetKey.intervals}. - # - # Note: The following fields are mutually exclusive: `interval`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] count - # @return [::Integer] - # Number of items that have this facet value. - class FacetValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Summary of the top N search results specified by the summary spec. - # @!attribute [rw] summary_text - # @return [::String] - # The summary content. - # @!attribute [rw] summary_skipped_reasons - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummarySkippedReason>] - # Additional summary-skipped reasons. This provides the reason for ignored - # cases. If nothing is skipped, this field is not set. - # @!attribute [rw] safety_attributes - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SafetyAttributes] - # A collection of Safety Attribute categories and their associated - # confidence scores. - # @!attribute [rw] summary_with_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::SummaryWithMetadata] - # Summary with metadata information. - class Summary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Safety Attribute categories and their associated confidence scores. - # @!attribute [rw] categories - # @return [::Array<::String>] - # The display names of Safety Attribute categories associated with the - # generated content. Order matches the Scores. - # @!attribute [rw] scores - # @return [::Array<::Float>] - # The confidence scores of the each category, higher - # value means higher confidence. Order matches the Categories. - class SafetyAttributes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Citation metadata. - # @!attribute [rw] citations - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Citation>] - # Citations for segments. - class CitationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Citation info for a segment. - # @!attribute [rw] start_index - # @return [::Integer] - # Index indicates the start of the segment, measured in bytes/unicode. - # @!attribute [rw] end_index - # @return [::Integer] - # End of the attributed segment, exclusive. - # @!attribute [rw] sources - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationSource>] - # Citation sources for the attributed segment. - class Citation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Citation source. - # @!attribute [rw] reference_index - # @return [::Integer] - # Document reference index from SummaryWithMetadata.references. - # It is 0-indexed and the value will be zero if the reference_index is - # not set explicitly. - class CitationSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Document reference. - # @!attribute [rw] title - # @return [::String] - # Title of the document. - # @!attribute [rw] document - # @return [::String] - # Required. - # {::Google::Cloud::DiscoveryEngine::V1::Document#name Document.name} of the - # document. Full resource name of the referenced document, in the format - # `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`. - # @!attribute [rw] uri - # @return [::String] - # Cloud Storage or HTTP uri for the document. - # @!attribute [rw] chunk_contents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference::ChunkContent>] - # List of cited chunk contents derived from document content. - class Reference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Chunk content. - # @!attribute [rw] content - # @return [::String] - # Chunk textual content. - # @!attribute [rw] page_identifier - # @return [::String] - # Page identifier. - class ChunkContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Summary with metadata information. - # @!attribute [rw] summary - # @return [::String] - # Summary text with no citation information. - # @!attribute [rw] citation_metadata - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::CitationMetadata] - # Citation metadata for given summary. - # @!attribute [rw] references - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::Summary::Reference>] - # Document References. - class SummaryWithMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Enum for summary-skipped reasons. - module SummarySkippedReason - # Default value. The summary skipped reason is not specified. - SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0 - - # The adversarial query ignored case. - # - # Only used when - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_adversarial_query SummarySpec.ignore_adversarial_query} - # is set to `true`. - ADVERSARIAL_QUERY_IGNORED = 1 - - # The non-summary seeking query ignored case. - # - # Google skips the summary if the query is chit chat. - # Only used when - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec#ignore_non_summary_seeking_query 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 no relevant content case. - # - # Google skips the summary if there is no relevant content in the - # retrieved search results. - NO_RELEVANT_CONTENT = 6 - - # The jail-breaking query ignored case. - # - # For example, "Reply in the tone of a competing company's CEO". - # Only used when - # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query] - # is set to `true`. - JAIL_BREAKING_QUERY_IGNORED = 7 - - # The customer policy violation case. - # - # Google skips the summary if there is a customer policy violation - # detected. The policy is defined by the customer. - CUSTOMER_POLICY_VIOLATION = 8 - - # The non-answer seeking query ignored case. - # - # Google skips the summary if the query doesn't have clear intent. - # Only used when - # [SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_answer_seeking_query] - # is set to `true`. - NON_SUMMARY_SEEKING_QUERY_IGNORED_V2 = 9 - - # The time out case. - # - # Google skips the summary if the time out. - TIME_OUT = 10 - end - end - - # Information describing query expansion including whether expansion has - # occurred. - # @!attribute [rw] expanded_query - # @return [::Boolean] - # Bool describing whether query expansion has occurred. - # @!attribute [rw] pinned_result_count - # @return [::Integer] - # Number of pinned results. This field will only be set when expansion - # happens and - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec#pin_unexpanded_results SearchRequest.QueryExpansionSpec.pin_unexpanded_results} - # is set to true. - class QueryExpansionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information describing what natural language understanding was - # done on the input query. - # @!attribute [rw] extracted_filters - # @return [::String] - # The filters that were extracted from the input query. - # @!attribute [rw] rewritten_query - # @return [::String] - # Rewritten input query minus the extracted filters. - # @!attribute [rw] classified_intents - # @return [::Array<::String>] - # The classified intents from the input query. - # @!attribute [rw] structured_extracted_filter - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter] - # The filters that were extracted from the input query represented in a - # structured form. - class NaturalLanguageQueryUnderstandingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The filters that were extracted from the input query represented in a - # structured form. - # @!attribute [rw] expression - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression] - # The expression denoting the filter that was extracted from the input - # query in a structured form. It can be a simple expression denoting a - # single string, numerical or geolocation constraint or a compound - # expression which is a combination of multiple expressions connected - # using logical (OR and AND) operators. - class StructuredExtractedFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Constraint expression of a string field. - # @!attribute [rw] field_name - # @return [::String] - # Name of the string field as defined in the schema. - # @!attribute [rw] values - # @return [::Array<::String>] - # Values of the string field. The record will only be returned if the - # field value matches one of the values specified here. - # @!attribute [rw] query_segment - # @return [::String] - # Identifies the keywords within the search query that match a filter. - class StringConstraint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Constraint expression of a number field. Example: price < 100. - # @!attribute [rw] field_name - # @return [::String] - # Name of the numerical field as defined in the schema. - # @!attribute [rw] comparison - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint::Comparison] - # The comparison operation performed between the field value and the - # value specified in the constraint. - # @!attribute [rw] value - # @return [::Float] - # The value specified in the numerical constraint. - # @!attribute [rw] query_segment - # @return [::String] - # Identifies the keywords within the search query that match a filter. - class NumberConstraint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The comparison operation that was performed. - module Comparison - # Undefined comparison operator. - COMPARISON_UNSPECIFIED = 0 - - # Denotes equality `=` operator. - EQUALS = 1 - - # Denotes less than or equal to `<=` operator. - LESS_THAN_EQUALS = 2 - - # Denotes less than `<` operator. - LESS_THAN = 3 - - # Denotes greater than or equal to `>=` operator. - GREATER_THAN_EQUALS = 4 - - # Denotes greater than `>` operator. - GREATER_THAN = 5 - end - end - - # Constraint of a geolocation field. - # Name of the geolocation field as defined in the schema. - # @!attribute [rw] field_name - # @return [::String] - # The name of the geolocation field as defined in the schema. - # @!attribute [rw] address - # @return [::String] - # The reference address that was inferred from the input query. The - # proximity of the reference address to the geolocation field will be - # used to filter the results. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude of the geolocation inferred from the input query. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude of the geolocation inferred from the input query. - # @!attribute [rw] radius_in_meters - # @return [::Float] - # The radius in meters around the address. The record is returned if - # the location of the geolocation field is within the radius. - class GeolocationConstraint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Logical `And` operator. - # @!attribute [rw] expressions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] - # The expressions that were ANDed together. - class AndExpression - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Logical `Or` operator. - # @!attribute [rw] expressions - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::Expression>] - # The expressions that were ORed together. - class OrExpression - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The expression denoting the filter that was extracted from the input - # query. - # @!attribute [rw] string_constraint - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::StringConstraint] - # String constraint expression. - # - # Note: The following fields are mutually exclusive: `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_constraint - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::NumberConstraint] - # Numerical constraint expression. - # - # Note: The following fields are mutually exclusive: `number_constraint`, `string_constraint`, `geolocation_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] geolocation_constraint - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::GeolocationConstraint] - # Geolocation constraint expression. - # - # Note: The following fields are mutually exclusive: `geolocation_constraint`, `string_constraint`, `number_constraint`, `and_expr`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] and_expr - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::AndExpression] - # Logical "And" compound operator connecting multiple expressions. - # - # Note: The following fields are mutually exclusive: `and_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `or_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] or_expr - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse::NaturalLanguageQueryUnderstandingInfo::StructuredExtractedFilter::OrExpression] - # Logical "Or" compound operator connecting multiple expressions. - # - # Note: The following fields are mutually exclusive: `or_expr`, `string_constraint`, `number_constraint`, `geolocation_constraint`, `and_expr`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Expression - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Information about the session. - # @!attribute [rw] name - # @return [::String] - # Name of the session. - # If the auto-session mode is used (when - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#session SearchRequest.session} - # ends with "-"), this field holds the newly generated session name. - # @!attribute [rw] query_id - # @return [::String] - # Query ID that corresponds to this search API call. - # One session can have multiple turns, each with a unique query ID. - # - # By specifying the session name and this query ID in the Answer API call, - # the answer generation happens in the context of the search results from - # this search call. - class SessionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Semantic state of the search response. - module SemanticState - # Default value. Should not be used. - SEMANTIC_STATE_UNSPECIFIED = 0 - - # Semantic search was disabled for this search response. - DISABLED = 1 - - # Semantic search was enabled for this search response. - ENABLED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb deleted file mode 100644 index 434617ba702a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/search_tuning_service.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models SearchTuningService.ListCustomModels} - # method. - # @!attribute [rw] data_store - # @return [::String] - # Required. The resource name of the parent Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to fetch the models - # from. - class ListCustomModelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models SearchTuningService.ListCustomModels} - # method. - # @!attribute [rw] models - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CustomTuningModel>] - # List of custom tuning models. - class ListCustomModelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model SearchTuningService.TrainCustomModel} - # method. - # @!attribute [rw] gcs_training_input - # @return [::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput] - # Cloud Storage training input. - # @!attribute [rw] data_store - # @return [::String] - # Required. The resource name of the Data Store, such as - # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. - # This field is used to identify the data store where to train the models. - # @!attribute [rw] model_type - # @return [::String] - # Model to be trained. Supported values are: - # - # * **search-tuning**: Fine tuning the search system based on data provided. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # The desired location of errors incurred during the data ingestion and - # training. - # @!attribute [rw] model_id - # @return [::String] - # If not provided, a UUID will be generated. - class TrainCustomModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Cloud Storage training data input. - # @!attribute [rw] corpus_data_path - # @return [::String] - # The Cloud Storage corpus data which could be associated in train data. - # The data path format is `gs:///`. - # A newline delimited jsonl/ndjson file. - # - # For search-tuning model, each line should have the _id, title - # and text. Example: - # `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}` - # @!attribute [rw] query_data_path - # @return [::String] - # The gcs query data which could be associated in train data. - # The data path format is `gs:///`. - # A newline delimited jsonl/ndjson file. - # - # For search-tuning model, each line should have the _id - # and text. Example: \\{"_id": "query1", "text": "example query"} - # @!attribute [rw] train_data_path - # @return [::String] - # Cloud Storage training data path whose format should be - # `gs:///`. The file should be in tsv - # format. Each line should have the doc_id and query_id and score (number). - # - # For search-tuning model, it should have the query-id corpus-id - # score as tsv file header. The score should be a number in `[0, inf+)`. - # The larger the number is, the more relevant the pair is. Example: - # - # * `query-id\tcorpus-id\tscore` - # * `query1\tdoc1\t1` - # @!attribute [rw] test_data_path - # @return [::String] - # Cloud Storage test data. Same format as train_data_path. If not provided, - # a random 80/20 train/test split will be performed on train_data_path. - class GcsTrainingInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response of the - # {::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest TrainCustomModelRequest}. - # This message is returned by the google.longrunning.Operations.response field. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the data. - # @!attribute [rw] error_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig] - # Echoes the destination for the complete errors in the request if set. - # @!attribute [rw] model_status - # @return [::String] - # The trained model status. Possible values are: - # - # * **bad-data**: The training data quality is bad. - # * **no-improvement**: Tuning didn't improve performance. Won't deploy. - # * **in-progress**: Model training job creation is in progress. - # * **training**: Model is actively training. - # * **evaluating**: The model is evaluating trained metrics. - # * **indexing**: The model trained metrics are indexing. - # * **ready**: The model is ready for serving. - # @!attribute [rw] metrics - # @return [::Google::Protobuf::Map{::String => ::Float}] - # The metrics of the trained model. - # @!attribute [rw] model_name - # @return [::String] - # Fully qualified name of the CustomTuningModel. - class TrainCustomModelResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Float] - class MetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata related to the progress of the TrainCustomModel operation. This is - # returned by the google.longrunning.Operation.metadata field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class TrainCustomModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb deleted file mode 100644 index 2cf0313e59af..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb +++ /dev/null @@ -1,261 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Configures metadata that is used to generate serving time results (e.g. - # search results or recommendation predictions). - # The ServingConfig is passed in the search and predict request and generates - # results. - # @!attribute [rw] media_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig::MediaConfig] - # The MediaConfig of the serving configuration. - # - # Note: The following fields are mutually exclusive: `media_config`, `generic_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] generic_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig::GenericConfig] - # The GenericConfig of the serving configuration. - # - # Note: The following fields are mutually exclusive: `generic_config`, `media_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` - # @!attribute [rw] display_name - # @return [::String] - # Required. The human readable serving config display name. Used in Discovery - # UI. - # - # This field must be a UTF-8 encoded string with a length limit of 128 - # characters. Otherwise, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] solution_type - # @return [::Google::Cloud::DiscoveryEngine::V1::SolutionType] - # Required. Immutable. Specifies the solution type that a serving config can - # be associated with. - # @!attribute [rw] model_id - # @return [::String] - # The id of the model to use at serving time. - # Currently only RecommendationModels are supported. - # Can be changed but only to a compatible model (e.g. - # others-you-may-like CTR to others-you-may-like CVR). - # - # Required when {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} - # is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] diversity_level - # @return [::String] - # How much diversity to use in recommendation model results e.g. - # `medium-diversity` or `high-diversity`. Currently supported values: - # - # * `no-diversity` - # * `low-diversity` - # * `medium-diversity` - # * `high-diversity` - # * `auto-diversity` - # - # If not specified, we choose default based on recommendation model - # type. Default value: `no-diversity`. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] ranking_expression - # @return [::String] - # The ranking expression controls the customized ranking on retrieval - # documents. To leverage this, document embedding is required. The ranking - # expression setting in ServingConfig applies to all search requests served - # by the serving config. However, if `SearchRequest.ranking_expression` is - # specified, it overrides the ServingConfig ranking expression. - # - # The ranking expression is a single function or multiple functions that are - # joined 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)`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. ServingConfig created timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. ServingConfig updated timestamp. - # @!attribute [rw] filter_control_ids - # @return [::Array<::String>] - # Filter controls to use in serving path. - # All triggered filter controls will be applied. - # Filter controls must be in the same data store as the serving config. - # Maximum of 20 filter controls. - # @!attribute [rw] boost_control_ids - # @return [::Array<::String>] - # Boost controls to use in serving path. - # All triggered boost controls will be applied. - # Boost controls must be in the same data store as the serving config. - # Maximum of 20 boost controls. - # @!attribute [rw] redirect_control_ids - # @return [::Array<::String>] - # IDs of the redirect controls. Only the first triggered redirect - # action is applied, even if multiple apply. Maximum number of - # specifications is 100. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] synonyms_control_ids - # @return [::Array<::String>] - # Condition synonyms specifications. If multiple synonyms conditions - # match, all matching synonyms controls in the list will execute. - # Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] oneway_synonyms_control_ids - # @return [::Array<::String>] - # Condition oneway synonyms specifications. If multiple oneway synonyms - # conditions match, all matching oneway synonyms controls in the list - # will execute. Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] dissociate_control_ids - # @return [::Array<::String>] - # Condition do not associate specifications. If multiple do not - # associate conditions match, all matching do not associate controls in - # the list will execute. - # Order does not matter. - # Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] replacement_control_ids - # @return [::Array<::String>] - # Condition replacement specifications. - # Applied according to the order in the list. - # A previously replaced term can not be re-replaced. - # Maximum number of specifications is 100. - # - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_SEARCH SOLUTION_TYPE_SEARCH}. - # @!attribute [rw] ignore_control_ids - # @return [::Array<::String>] - # Condition ignore specifications. If multiple ignore - # conditions match, all matching ignore controls in the list will - # execute. - # Order does not matter. - # Maximum number of specifications is 100. - # @!attribute [rw] promote_control_ids - # @return [::Array<::String>] - # Condition promote specifications. - # - # Maximum number of specifications is 100. - class ServingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies the configurations needed for Media Discovery. Currently we - # support: - # - # * `demote_content_watched`: Threshold for watched content demotion. - # Customers can specify if using watched content demotion or use viewed - # detail page. Using the content watched demotion, customers need to specify - # the watched minutes or percentage exceeds the threshold, the content will - # be demoted in the recommendation result. - # * `promote_fresh_content`: cutoff days for fresh content promotion. - # Customers can specify if using content freshness promotion. If the content - # was published within the cutoff days, the content will be promoted in the - # recommendation result. - # Can only be set if - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType SolutionType} is - # {::Google::Cloud::DiscoveryEngine::V1::SolutionType::SOLUTION_TYPE_RECOMMENDATION SOLUTION_TYPE_RECOMMENDATION}. - # @!attribute [rw] content_watched_percentage_threshold - # @return [::Float] - # Specifies the content watched percentage threshold for demotion. - # Threshold value must be between [0, 1.0] inclusive. - # - # Note: The following fields are mutually exclusive: `content_watched_percentage_threshold`, `content_watched_seconds_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] content_watched_seconds_threshold - # @return [::Float] - # Specifies the content watched minutes threshold for demotion. - # - # Note: The following fields are mutually exclusive: `content_watched_seconds_threshold`, `content_watched_percentage_threshold`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] demotion_event_type - # @return [::String] - # Specifies the event type used for demoting recommendation result. - # Currently supported values: - # - # * `view-item`: Item viewed. - # * `media-play`: Start/resume watching a video, playing a song, etc. - # * `media-complete`: Finished or stopped midway through a video, song, - # etc. - # - # If unset, watch history demotion will not be applied. Content freshness - # demotion will still be applied. - # @!attribute [rw] demote_content_watched_past_days - # @return [::Integer] - # Optional. Specifies the number of days to look back for demoting watched - # content. If set to zero or unset, defaults to the maximum of 365 days. - # @!attribute [rw] content_freshness_cutoff_days - # @return [::Integer] - # Specifies the content freshness used for recommendation result. - # Contents will be demoted if contents were published for more than content - # freshness cutoff days. - class MediaConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the configurations needed for Generic Discovery.Currently we - # support: - # - # * `content_search_spec`: configuration for generic content search. - # @!attribute [rw] content_search_spec - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec] - # Specifies the expected behavior of content search. - # Only valid for content-search enabled data store. - class GenericConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb deleted file mode 100644 index 471f1b569e08..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request for UpdateServingConfig method. - # @!attribute [rw] serving_config - # @return [::Google::Cloud::DiscoveryEngine::V1::ServingConfig] - # Required. The ServingConfig to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Indicates which fields in the provided - # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig} to update. - # The following are NOT supported: - # - # * {::Google::Cloud::DiscoveryEngine::V1::ServingConfig#name ServingConfig.name} - # - # If not set, all supported fields are updated. - class UpdateServingConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb deleted file mode 100644 index 4f1cf4d4d1f5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/session.rb +++ /dev/null @@ -1,134 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # External session proto definition. - # @!attribute [rw] name - # @return [::String] - # Immutable. Fully qualified name - # `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The display name of the session. - # - # This field is used to identify the session in the UI. - # By default, the display name is the first turn query text in the session. - # @!attribute [rw] state - # @return [::Google::Cloud::DiscoveryEngine::V1::Session::State] - # The state of the session. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # A unique identifier for tracking users. - # @!attribute [rw] turns - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::Session::Turn>] - # Turns. - # @!attribute [rw] labels - # @return [::Array<::String>] - # Optional. The labels for the session. - # Can be set as filter in ListSessionsRequest. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the session started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the session finished. - # @!attribute [rw] is_pinned - # @return [::Boolean] - # Optional. Whether the session is pinned, pinned session will be displayed - # on the top of the session list. - class Session - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a turn, including a query from the user and a - # answer from service. - # @!attribute [rw] query - # @return [::Google::Cloud::DiscoveryEngine::V1::Query] - # Optional. The user query. May not be set if this turn is merely - # regenerating an answer to a different turn - # @!attribute [rw] answer - # @return [::String] - # Optional. The resource name of the answer to the user query. - # - # Only set if the answer generation (/answer API call) happened in this - # turn. - # @!attribute [r] detailed_answer - # @return [::Google::Cloud::DiscoveryEngine::V1::Answer] - # Output only. In - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} - # API, if - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest#include_answer_details GetSessionRequest.include_answer_details} - # is set to true, this field will be populated when getting answer query - # session. - # @!attribute [r] detailed_assist_answer - # @return [::Google::Cloud::DiscoveryEngine::V1::AssistAnswer] - # Output only. In - # {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession} - # API, if - # {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest#include_answer_details GetSessionRequest.include_answer_details} - # is set to true, this field will be populated when getting assistant - # session. - # @!attribute [rw] query_config - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Represents metadata related to the query config, for example - # LLM model and version used, model parameters (temperature, grounding - # parameters, etc.). The prefix "google." is reserved for Google-developed - # functionality. - class Turn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class QueryConfigEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Enumeration of the state of the session. - module State - # State is unspecified. - STATE_UNSPECIFIED = 0 - - # The session is currently open. - IN_PROGRESS = 1 - end - end - - # Defines a user inputed query. - # @!attribute [rw] text - # @return [::String] - # Plain text. - # @!attribute [r] query_id - # @return [::String] - # Output only. Unique Id for the query. - class Query - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb deleted file mode 100644 index 47153c087ee7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +++ /dev/null @@ -1,186 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # SiteSearchEngine captures DataStore level site search persisting - # configurations. It is a singleton value per data store. - # @!attribute [rw] name - # @return [::String] - # The fully qualified resource name of the site search engine. - # Format: `projects/*/locations/*/dataStores/*/siteSearchEngine` - class SiteSearchEngine - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A target site for the SiteSearchEngine. - # @!attribute [r] name - # @return [::String] - # Output only. The fully qualified resource name of the target site. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}` - # The `target_site_id` is system-generated. - # @!attribute [rw] provided_uri_pattern - # @return [::String] - # Required. Input only. The user provided URI pattern from which the - # `generated_uri_pattern` is generated. - # @!attribute [rw] type - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::Type] - # The type of the target site, e.g., whether the site is to be included or - # excluded. - # @!attribute [rw] exact_match - # @return [::Boolean] - # Immutable. If set to false, a uri_pattern is generated to include all pages - # whose address contains the provided_uri_pattern. If set to true, an - # uri_pattern is generated to try to be an exact match of the - # provided_uri_pattern or just the specific page if the provided_uri_pattern - # is a specific one. provided_uri_pattern is always normalized to - # generate the URI pattern to be used by the search engine. - # @!attribute [r] generated_uri_pattern - # @return [::String] - # Output only. This is system-generated based on the provided_uri_pattern. - # @!attribute [r] root_domain_uri - # @return [::String] - # Output only. Root domain of the provided_uri_pattern. - # @!attribute [r] site_verification_info - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteVerificationInfo] - # Output only. Site ownership and validity verification status. - # @!attribute [r] indexing_status - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::IndexingStatus] - # Output only. Indexing status. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The target site's last updated time. - # @!attribute [r] failure_reason - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::FailureReason] - # Output only. Failure reason. - class TargetSite - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Site search indexing failure reasons. - # @!attribute [rw] quota_failure - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite::FailureReason::QuotaFailure] - # Failed due to insufficient quota. - class FailureReason - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Failed due to insufficient quota. - # @!attribute [rw] total_required_quota - # @return [::Integer] - # This number is an estimation on how much total quota this project needs - # to successfully complete indexing. - class QuotaFailure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Possible target site types. - module Type - # This value is unused. In this case, server behavior defaults to - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite::Type::INCLUDE Type.INCLUDE}. - TYPE_UNSPECIFIED = 0 - - # Include the target site. - INCLUDE = 1 - - # Exclude the target site. - EXCLUDE = 2 - end - - # Target site indexing status enumeration. - module IndexingStatus - # Defaults to SUCCEEDED. - INDEXING_STATUS_UNSPECIFIED = 0 - - # The target site is in the update queue and will be picked up by indexing - # pipeline. - PENDING = 1 - - # The target site fails to be indexed. - FAILED = 2 - - # The target site has been indexed. - SUCCEEDED = 3 - - # The previously indexed target site has been marked to be deleted. This is - # a transitioning state which will resulted in either: - # 1. target site deleted if unindexing is successful; - # 2. state reverts to SUCCEEDED if the unindexing fails. - DELETING = 4 - - # The target site change is pending but cancellable. - CANCELLABLE = 5 - - # The target site change is cancelled. - CANCELLED = 6 - end - end - - # Verification information for target sites in advanced site search. - # @!attribute [rw] site_verification_state - # @return [::Google::Cloud::DiscoveryEngine::V1::SiteVerificationInfo::SiteVerificationState] - # Site verification state indicating the ownership and validity. - # @!attribute [rw] verify_time - # @return [::Google::Protobuf::Timestamp] - # Latest site verification time. - class SiteVerificationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Site verification state. - module SiteVerificationState - # Defaults to VERIFIED. - SITE_VERIFICATION_STATE_UNSPECIFIED = 0 - - # Site ownership verified. - VERIFIED = 1 - - # Site ownership pending verification or verification failed. - UNVERIFIED = 2 - - # Site exempt from verification, e.g., a public website that opens to all. - EXEMPTED = 3 - end - end - - # A sitemap for the SiteSearchEngine. - # @!attribute [rw] uri - # @return [::String] - # Public URI for the sitemap, e.g. `www.example.com/sitemap.xml`. - # @!attribute [r] name - # @return [::String] - # Output only. The fully qualified resource name of the sitemap. - # `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/sitemaps/*` - # The `sitemap_id` suffix is system-generated. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The sitemap's creation time. - class Sitemap - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb deleted file mode 100644 index 7f087d84968a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +++ /dev/null @@ -1,672 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine SiteSearchEngineService.GetSiteSearchEngine} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to access the [SiteSearchEngine], - # regardless of whether or not it exists, a PERMISSION_DENIED error is - # returned. - class GetSiteSearchEngineRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site SiteSearchEngineService.CreateTargetSite} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @!attribute [rw] target_site - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to - # create. - class CreateTargetSiteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site SiteSearchEngineService.CreateTargetSite} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class CreateTargetSiteMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource shared by all TargetSites being created. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # The parent field in the CreateBookRequest messages must either be empty or - # match this field. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest>] - # Required. The request message specifying the resources to create. - # A maximum of 20 TargetSites can be created in a batch. - class BatchCreateTargetSitesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site SiteSearchEngineService.GetTargetSite} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - class GetTargetSiteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site SiteSearchEngineService.UpdateTargetSite} - # method. - # @!attribute [rw] target_site - # @return [::Google::Cloud::DiscoveryEngine::V1::TargetSite] - # Required. The target site to update. - # If the caller does not have permission to update the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} to update - # does not exist, a NOT_FOUND error is returned. - class UpdateTargetSiteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site SiteSearchEngineService.UpdateTargetSite} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class UpdateTargetSiteMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site SiteSearchEngineService.DeleteTargetSite} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/targetSites/{target_site}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}, regardless of - # whether or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} - # does not exist, a NOT_FOUND error is returned. - class DeleteTargetSiteRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site SiteSearchEngineService.DeleteTargetSite} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteTargetSiteMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites SiteSearchEngineService.ListTargetSites} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent site search engine resource name, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # - # If the caller does not have permission to list - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite}s under this site - # search engine, regardless of whether or not this branch exists, a - # PERMISSION_DENIED error is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListTargetSites` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargetSites` - # must match the call that provided the page token. - class ListTargetSitesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites SiteSearchEngineService.ListTargetSites} - # method. - # @!attribute [rw] target_sites - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # List of TargetSites. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of items matching the request. - # This will always be populated in the response. - class ListTargetSitesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class BatchCreateTargetSiteMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites SiteSearchEngineService.BatchCreateTargetSites} - # method. - # @!attribute [rw] target_sites - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # TargetSites created. - class BatchCreateTargetSitesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap SiteSearchEngineService.CreateSitemap} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @!attribute [rw] sitemap - # @return [::Google::Cloud::DiscoveryEngine::V1::Sitemap] - # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create. - class CreateSitemapRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap SiteSearchEngineService.DeleteSitemap} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Full resource name of - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`. - # - # If the caller does not have permission to access the - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether - # or not it exists, a PERMISSION_DENIED error is returned. - # - # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does - # not exist, a NOT_FOUND error is returned. - class DeleteSitemapRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps SiteSearchEngineService.FetchSitemaps} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @!attribute [rw] matcher - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher] - # Optional. If specified, fetches the matching - # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified, - # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}. - class FetchSitemapsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s by - # their uris. - # @!attribute [rw] uris - # @return [::Array<::String>] - # The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} uris. - class UrisMatcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. - # Currently only supports uris matcher. - # @!attribute [rw] uris_matcher - # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::UrisMatcher] - # Matcher by sitemap URIs. - class Matcher - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap SiteSearchEngineService.CreateSitemap} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class CreateSitemapMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap SiteSearchEngineService.DeleteSitemap} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DeleteSitemapMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps SiteSearchEngineService.FetchSitemaps} - # method. - # @!attribute [rw] sitemaps_metadata - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse::SitemapMetadata>] - # List of {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s fetched. - class FetchSitemapsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} and its - # metadata. - # @!attribute [rw] sitemap - # @return [::Google::Cloud::DiscoveryEngine::V1::Sitemap] - # The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}. - class SitemapMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} - # method. - # @!attribute [rw] site_search_engine - # @return [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - class EnableAdvancedSiteSearchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} - # method. - class EnableAdvancedSiteSearchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search SiteSearchEngineService.EnableAdvancedSiteSearch} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class EnableAdvancedSiteSearchMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} - # method. - # @!attribute [rw] site_search_engine - # @return [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as - # `projects/{project}/locations/{location}/dataStores/{data_store_id}/siteSearchEngine`. - class DisableAdvancedSiteSearchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} - # method. - class DisableAdvancedSiteSearchResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search SiteSearchEngineService.DisableAdvancedSiteSearch} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class DisableAdvancedSiteSearchMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} - # method. - # @!attribute [rw] site_search_engine - # @return [::String] - # Required. Full resource name of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such - # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`. - # @!attribute [rw] uris - # @return [::Array<::String>] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in - # `site_search_engine`. - # @!attribute [rw] site_credential - # @return [::String] - # Optional. Credential id to use for crawling. - class RecrawlUrisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} - # method. - # @!attribute [rw] failure_samples - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo>] - # Details for a sample of up to 10 `failed_uris`. - # @!attribute [rw] failed_uris - # @return [::Array<::String>] - # URIs that were not crawled before the LRO terminated. - class RecrawlUrisResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details about why a particular URI failed to be crawled. Each FailureInfo - # contains one FailureReason per CorpusType. - # @!attribute [rw] uri - # @return [::String] - # URI that failed to be crawled. - # @!attribute [rw] failure_reasons - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo::FailureReason>] - # List of failure reasons by corpus type (e.g. desktop, mobile). - class FailureInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details about why crawling failed for a particular CorpusType, e.g., - # DESKTOP and MOBILE crawling may fail for different reasons. - # @!attribute [rw] corpus_type - # @return [::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisResponse::FailureInfo::FailureReason::CorpusType] - # DESKTOP, MOBILE, or CORPUS_TYPE_UNSPECIFIED. - # @!attribute [rw] error_message - # @return [::String] - # Reason why the URI was not crawled. - class FailureReason - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # CorpusType for the failed crawling operation. - module 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 - end - end - end - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris SiteSearchEngineService.RecrawlUris} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] invalid_uris - # @return [::Array<::String>] - # Unique URIs in the request that have invalid format. Sample limited to - # 1000. - # @!attribute [rw] invalid_uris_count - # @return [::Integer] - # Total number of unique URIs in the request that have invalid format. - # @!attribute [rw] noindex_uris - # @return [::Array<::String>] - # URIs that have no index meta tag. Sample limited to 1000. - # @!attribute [rw] noindex_uris_count - # @return [::Integer] - # Total number of URIs that have no index meta tag. - # @!attribute [rw] uris_not_matching_target_sites - # @return [::Array<::String>] - # 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. Sample limited to 1000. - # @!attribute [rw] uris_not_matching_target_sites_count - # @return [::Integer] - # Total number of URIs that don't match any TargetSites. - # @!attribute [rw] valid_uris_count - # @return [::Integer] - # Total number of unique URIs in the request that are not in invalid_uris. - # @!attribute [rw] success_count - # @return [::Integer] - # Total number of URIs that have been crawled so far. - # @!attribute [rw] pending_count - # @return [::Integer] - # Total number of URIs that have yet to be crawled. - # @!attribute [rw] quota_exceeded_count - # @return [::Integer] - # Total number of URIs that were rejected due to insufficient indexing - # resources. - class RecrawlUrisMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource shared by all TargetSites being verified. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - class BatchVerifyTargetSitesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} - # method. - class BatchVerifyTargetSitesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites SiteSearchEngineService.BatchVerifyTargetSites} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - class BatchVerifyTargetSitesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status SiteSearchEngineService.FetchDomainVerificationStatus} - # method. - # @!attribute [rw] site_search_engine - # @return [::String] - # Required. The site search engine resource under which we fetch all the - # domain verification status. - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine`. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. If - # unspecified, server will pick an appropriate default. The maximum value is - # 1000; values above 1000 will be coerced to 1000. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `FetchDomainVerificationStatus` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `FetchDomainVerificationStatus` must match the call that provided the page - # token. - class FetchDomainVerificationStatusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status SiteSearchEngineService.FetchDomainVerificationStatus} - # method. - # @!attribute [rw] target_sites - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::TargetSite>] - # List of TargetSites containing the site verification status. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of items matching the request. - # This will always be populated in the response. - class FetchDomainVerificationStatusResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb deleted file mode 100644 index 3750ae14d954..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +++ /dev/null @@ -1,548 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # UserEvent captures all metadata information Discovery Engine API needs to - # know about how end users interact with your website. - # @!attribute [rw] event_type - # @return [::String] - # 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 - # * `add-feedback`: Add a user feedback. - # - # 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. - # - # Custom conversion value: - # - # * `conversion`: Customer defined conversion event. - # @!attribute [rw] conversion_type - # @return [::String] - # Optional. Conversion type. - # - # Required if - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} - # is `conversion`. This is a customer-defined conversion name in lowercase - # letters or numbers separated by "-", such as "watch", "good-visit" etc. - # - # Do not set the field if - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} - # is not `conversion`. This mixes the custom conversion event with predefined - # events like `search`, `view-item` etc. - # @!attribute [rw] user_pseudo_id - # @return [::String] - # 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. - # @!attribute [rw] engine - # @return [::String] - # The {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} resource name, in the - # form of - # `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. - # - # Optional. Only required for - # {::Google::Cloud::DiscoveryEngine::V1::Engine Engine} produced user events. For - # example, user events from blended search. - # @!attribute [rw] data_store - # @return [::String] - # The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} resource full - # name, of the form - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. - # - # Optional. Only required for user events whose data store can't by - # determined by - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#engine UserEvent.engine} or - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#documents UserEvent.documents}. - # If data store is set in the parent of write/import/collect user event - # requests, this field can be omitted. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # Only required for - # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events UserEventService.ImportUserEvents} - # method. Timestamp of when the user event happened. - # @!attribute [rw] user_info - # @return [::Google::Cloud::DiscoveryEngine::V1::UserInfo] - # Information about the end user. - # @!attribute [rw] direct_user_request - # @return [::Boolean] - # Should set to true if the request is made directly from the end user, in - # which case the - # {::Google::Cloud::DiscoveryEngine::V1::UserInfo#user_agent UserEvent.user_info.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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event UserEventService.CollectUserEvent}. - # @!attribute [rw] session_id - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#user_pseudo_id UserEvent.user_pseudo_id} - # as prefix. - # @!attribute [rw] page_info - # @return [::Google::Cloud::DiscoveryEngine::V1::PageInfo] - # Page metadata such as categories and other critical information for certain - # event types such as `view-category-page`. - # @!attribute [rw] attribution_token - # @return [::String] - # Token to attribute an API response to user action(s) to trigger the event. - # - # Highly recommended for user events that are the result of - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}. - # This field enables accurate attribution of recommendation model - # performance. - # - # The value must be one of: - # - # * {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} for events that are the result of - # {::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend RecommendationService.Recommend}. - # * {::Google::Cloud::DiscoveryEngine::V1::SearchResponse#attribution_token SearchResponse.attribution_token} for events that are the result of - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search 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 - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} - # as a URL parameter to product K's page. When recording events on product - # K's page, log the - # {::Google::Cloud::DiscoveryEngine::V1::RecommendResponse#attribution_token RecommendResponse.attribution_token} - # to this field. - # @!attribute [rw] filter - # @return [::String] - # 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 - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest SearchRequest} may contain - # a filter expression in - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#filter SearchRequest.filter} - # conforming to https://google.aip.dev/160#filtering. - # - # Similarly, for `view-item-list` events that are generated from a - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest RecommendRequest}, this - # field may be populated directly from - # {::Google::Cloud::DiscoveryEngine::V1::RecommendRequest#filter 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. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DocumentInfo>] - # List of {::Google::Cloud::DiscoveryEngine::V1::Document 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 - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#documents UserEvent.documents} - # is desired. - # @!attribute [rw] panel - # @return [::Google::Cloud::DiscoveryEngine::V1::PanelInfo] - # Panel metadata associated with this user event. - # @!attribute [rw] search_info - # @return [::Google::Cloud::DiscoveryEngine::V1::SearchInfo] - # {::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search SearchService.Search} - # details related to the event. - # - # This field should be set for `search` event. - # @!attribute [rw] completion_info - # @return [::Google::Cloud::DiscoveryEngine::V1::CompletionInfo] - # {::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query 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. - # @!attribute [rw] transaction_info - # @return [::Google::Cloud::DiscoveryEngine::V1::TransactionInfo] - # The transaction metadata (if any) associated with this user event. - # @!attribute [rw] tag_ids - # @return [::Array<::String>] - # 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. - # @!attribute [rw] promotion_ids - # @return [::Array<::String>] - # The promotion IDs if this is an event associated with promotions. - # Currently, this field is restricted to at most one ID. - # @!attribute [rw] attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DiscoveryEngine::V1::CustomAttribute}] - # 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. - # @!attribute [rw] media_info - # @return [::Google::Cloud::DiscoveryEngine::V1::MediaInfo] - # Media-specific info. - # @!attribute [rw] panels - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::PanelInfo>] - # Optional. List of panels associated with this event. - # Used for page-level impression data. - class UserEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::DiscoveryEngine::V1::CustomAttribute] - class AttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Detailed page information. - # @!attribute [rw] pageview_id - # @return [::String] - # 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. - # @!attribute [rw] page_category - # @return [::String] - # 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, 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. - # @!attribute [rw] uri - # @return [::String] - # 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. - # @!attribute [rw] referrer_uri - # @return [::String] - # 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. - class PageInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed search information. - # @!attribute [rw] search_query - # @return [::String] - # The user's search query. - # - # See - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#query 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 - # {::Google::Cloud::DiscoveryEngine::V1::SearchInfo#search_query search_query} or - # {::Google::Cloud::DiscoveryEngine::V1::PageInfo#page_category PageInfo.page_category} - # is required for `search` events. Other event types should not set this - # field. Otherwise, an `INVALID_ARGUMENT` error is returned. - # @!attribute [rw] order_by - # @return [::String] - # The order in which products are returned, if applicable. - # - # See - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#order_by 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. - # @!attribute [rw] offset - # @return [::Integer] - # An integer that specifies the current offset for pagination (the 0-indexed - # starting location, amongst the products deemed by the API as relevant). - # - # See - # {::Google::Cloud::DiscoveryEngine::V1::SearchRequest#offset 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. - class SearchInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed completion information including completion attribution token and - # clicked completion info. - # @!attribute [rw] selected_suggestion - # @return [::String] - # End user selected - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion#suggestion CompleteQueryResponse.QuerySuggestion.suggestion}. - # @!attribute [rw] selected_position - # @return [::Integer] - # End user selected - # {::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse::QuerySuggestion#suggestion CompleteQueryResponse.QuerySuggestion.suggestion} - # position, starting from 0. - class CompletionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A transaction represents the entire purchase transaction. - # @!attribute [rw] value - # @return [::Float] - # 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. - # @!attribute [rw] currency - # @return [::String] - # Required. Currency code. Use three-character ISO-4217 code. - # @!attribute [rw] transaction_id - # @return [::String] - # The transaction ID with a length limit of 128 characters. - # @!attribute [rw] tax - # @return [::Float] - # All the taxes associated with the transaction. - # @!attribute [rw] cost - # @return [::Float] - # 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 = {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value value} - - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#tax tax} - - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#cost cost} - # @!attribute [rw] discount_value - # @return [::Float] - # The total discount(s) value applied to this transaction. - # This figure should be excluded from - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} - # - # For example, if a user paid - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} - # amount, then nominal (pre-discount) value of the transaction is the sum of - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value} - # and - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#discount_value TransactionInfo.discount_value} - # - # This means that profit is calculated the same way, regardless of the - # discount value, and that - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#discount_value TransactionInfo.discount_value} - # can be larger than - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value TransactionInfo.value}: - # - # * Profit = {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#value value} - - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#tax tax} - - # {::Google::Cloud::DiscoveryEngine::V1::TransactionInfo#cost cost} - class TransactionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed document information associated with a user event. - # @!attribute [rw] id - # @return [::String] - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} resource ID. - # - # Note: The following fields are mutually exclusive: `id`, `name`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} resource full - # name, of the form: - # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}` - # - # Note: The following fields are mutually exclusive: `name`, `id`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] uri - # @return [::String] - # The {::Google::Cloud::DiscoveryEngine::V1::Document Document} URI - only - # allowed for website data stores. - # - # Note: The following fields are mutually exclusive: `uri`, `id`, `name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] quantity - # @return [::Integer] - # Quantity of the Document associated with the user event. Defaults to 1. - # - # For example, this field is 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` - # @!attribute [rw] promotion_ids - # @return [::Array<::String>] - # The promotion IDs associated with this Document. - # Currently, this field is restricted to at most one ID. - # @!attribute [r] joined - # @return [::Boolean] - # Output only. Whether the referenced Document can be found in the data - # store. - # @!attribute [rw] conversion_value - # @return [::Float] - # Optional. The conversion value associated with this Document. - # Must be set if - # {::Google::Cloud::DiscoveryEngine::V1::UserEvent#event_type UserEvent.event_type} - # is "conversion". - # - # For example, a value of 1000 signifies that 1000 seconds were spent viewing - # a Document for the `watch` conversion type. - class DocumentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detailed panel information associated with a user event. - # @!attribute [rw] panel_id - # @return [::String] - # Required. The panel ID. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the panel. - # @!attribute [rw] panel_position - # @return [::Integer] - # The ordered position of the panel, if shown to the user with other panels. - # If set, then - # {::Google::Cloud::DiscoveryEngine::V1::PanelInfo#total_panels total_panels} must - # also be set. - # @!attribute [rw] total_panels - # @return [::Integer] - # The total number of panels, including this one, shown to the user. - # Must be set if - # {::Google::Cloud::DiscoveryEngine::V1::PanelInfo#panel_position panel_position} - # is set. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::DocumentInfo>] - # Optional. The document IDs associated with this panel. - class PanelInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Media-specific user event information. - # @!attribute [rw] media_progress_duration - # @return [::Google::Protobuf::Duration] - # The media progress time in seconds, if applicable. - # For example, if the end user has finished 90 seconds of a playback video, - # then - # {::Google::Protobuf::Duration#seconds MediaInfo.media_progress_duration.seconds} - # should be set to 90. - # @!attribute [rw] media_progress_percentage - # @return [::Float] - # Media progress should be computed using only the - # {::Google::Cloud::DiscoveryEngine::V1::MediaInfo#media_progress_duration 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. - class MediaInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb deleted file mode 100644 index 810fd4851846..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for WriteUserEvent method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # If the write user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the write user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] user_event - # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] - # Required. User event to write. - # @!attribute [rw] write_async - # @return [::Boolean] - # If set to true, the user event is written asynchronously after - # validation, and the API responds without waiting for the write. - class WriteUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CollectUserEvent method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # If the collect user event action is applied in - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} level, the format - # is: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`. - # If the collect user event action is applied in - # [Location][google.cloud.location.Location] level, for example, the event - # with {::Google::Cloud::DiscoveryEngine::V1::Document Document} across multiple - # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, the format is: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] user_event - # @return [::String] - # Required. URL encoded UserEvent proto with a length limit of 2,000,000 - # characters. - # @!attribute [rw] uri - # @return [::String] - # 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. - # @!attribute [rw] ets - # @return [::Integer] - # The event timestamp in milliseconds. This prevents browser caching of - # otherwise identical get requests. The name is abbreviated to reduce the - # payload bytes. - class CollectUserEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb deleted file mode 100644 index fd9ce0884a56..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # User License information assigned by the admin. - # @!attribute [rw] user_principal - # @return [::String] - # Required. Immutable. The user principal of the User, could be email address - # or other prinical identifier. This field is immutable. Admin assign - # licenses based on the user principal. - # @!attribute [rw] user_profile - # @return [::String] - # Optional. The user profile. - # We user user full name(First name + Last name) as user profile. - # @!attribute [r] license_assignment_state - # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicense::LicenseAssignmentState] - # Output only. License assignment state of the user. - # If the user is assigned with a license config, the user loggin will be - # assigned with the license; - # If the user's license assignment state is unassigned or unspecified, no - # license config will be associated to the user; - # @!attribute [rw] license_config - # @return [::String] - # Optional. The full resource name of the Subscription(LicenseConfig) - # assigned to the user. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. User created timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. User update timestamp. - # @!attribute [r] last_login_time - # @return [::Google::Protobuf::Timestamp] - # Output only. User last logged in time. - # If the user has not logged in yet, this field will be empty. - class UserLicense - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # License assignment state enumeration. - module LicenseAssignmentState - # Default value. - LICENSE_ASSIGNMENT_STATE_UNSPECIFIED = 0 - - # License assigned to the user. - ASSIGNED = 1 - - # No license assigned to the user. - # Deprecated, translated to NO_LICENSE. - UNASSIGNED = 2 - - # No license assigned to the user. - NO_LICENSE = 3 - - # User attempted to login but no license assigned to the user. - # This state is only used for no user first time login attempt but cannot - # get license assigned. - # Users already logged in but cannot get license assigned will be assigned - # NO_LICENSE state(License could be unassigned by admin). - NO_LICENSE_ATTEMPTED_LOGIN = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb deleted file mode 100644 index 6f76cd96c489..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module DiscoveryEngine - module V1 - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses UserLicenseService.ListUserLicenses}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, defaults to 10. The maximum value is 50; values - # above 50 will be coerced to 50. - # - # If this field is negative, an INVALID_ARGUMENT error is returned. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListUserLicenses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUserLicenses` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter for the list request. - # - # Supported fields: - # - # * `license_assignment_state` - # - # Examples: - # - # * `license_assignment_state = ASSIGNED` to list assigned user licenses. - # * `license_assignment_state = NO_LICENSE` to list not licensed users. - # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users - # who attempted login but no license assigned. - # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter - # out users who attempted login but no license assigned. - class ListUserLicensesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses UserLicenseService.ListUserLicenses}. - # @!attribute [rw] user_licenses - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # All the customer's - # {::Google::Cloud::DiscoveryEngine::V1::UserLicense UserLicense}s. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. If - # this field is omitted, there are no subsequent pages. - class ListUserLicensesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} - # method. - # @!attribute [rw] inline_source - # @return [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource] - # The inline source for the input content for document embeddings. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent [UserStore][] resource name, format: - # `projects/{project}/locations/{location}/userStores/{user_store_id}`. - # @!attribute [rw] delete_unassigned_user_licenses - # @return [::Boolean] - # Optional. If true, if user licenses removed associated license config, the - # user license will be deleted. By default which is false, the user license - # will be updated to unassigned state. - class BatchUpdateUserLicensesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inline source for the input config for BatchUpdateUserLicenses - # method. - # @!attribute [rw] user_licenses - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # Required. A list of user licenses to update. Each user license - # must have a valid - # {::Google::Cloud::DiscoveryEngine::V1::UserLicense#user_principal UserLicense.user_principal}. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The list of fields to update. - class InlineSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata related to the progress of the - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} - # operation. This will be returned by the google.longrunning.Operation.metadata - # field. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Operation create time. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Operation last update time. If the operation is done, this is also the - # finish time. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of user licenses successfully updated. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of user licenses that failed to be updated. - class BatchUpdateUserLicensesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses UserLicenseService.BatchUpdateUserLicenses} - # method. - # @!attribute [rw] user_licenses - # @return [::Array<::Google::Cloud::DiscoveryEngine::V1::UserLicense>] - # UserLicenses successfully updated. - # @!attribute [rw] error_samples - # @return [::Array<::Google::Rpc::Status>] - # A sample of errors encountered while processing the request. - class BatchUpdateUserLicensesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb deleted file mode 100644 index 1d0a9780457f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a whole or partial calendar date, such as a birthday. The time of - # day and time zone are either specified elsewhere or are insignificant. The - # date is relative to the Gregorian Calendar. This can represent one of the - # following: - # - # * A full date, with non-zero year, month, and day values - # * A month and day value, with a zero year, such as an anniversary - # * A year on its own, with zero month and day values - # * A year and month value, with a zero day, such as a credit card expiration - # date - # - # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] year - # @return [::Integer] - # Year of the date. Must be from 1 to 9999, or 0 to specify a date without - # a year. - # @!attribute [rw] month - # @return [::Integer] - # Month of a year. Must be from 1 to 12, or 0 to specify a year without a - # month and day. - # @!attribute [rw] day - # @return [::Integer] - # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - # to specify a year by itself or a year and month where the day isn't - # significant. - class Date - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile deleted file mode 100644 index e929583d3d35..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-discovery_engine-v1", path: "../" -else - gem "google-cloud-discovery_engine-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb deleted file mode 100644 index 65965d3696d4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/assistant_service/stream_assist.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_AssistantService_StreamAssist_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the stream_assist call in the AssistantService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist. -# -def stream_assist - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new - - # Call the stream_assist method to start streaming. - output = client.stream_assist request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse - output.each do |current_response| - p current_response - end -end -# [END discoveryengine_v1_generated_AssistantService_StreamAssist_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb deleted file mode 100644 index 36e2f5047a22..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/delete_cmek_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_cmek_config call in the CmekConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config. -# -def delete_cmek_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new - - # Call the delete_cmek_config method. - result = client.delete_cmek_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb deleted file mode 100644 index 008b493423cd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/get_cmek_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_cmek_config call in the CmekConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config. -# -def get_cmek_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new - - # Call the get_cmek_config method. - result = client.get_cmek_config request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig. - p result -end -# [END discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb deleted file mode 100644 index beac68861b79..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/list_cmek_configs.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_cmek_configs call in the CmekConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs. -# -def list_cmek_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new - - # Call the list_cmek_configs method. - result = client.list_cmek_configs request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse. - p result -end -# [END discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb deleted file mode 100644 index 4288e43e8481..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/cmek_config_service/update_cmek_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_cmek_config call in the CmekConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config. -# -def update_cmek_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new - - # Call the update_cmek_config method. - result = client.update_cmek_config request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb deleted file mode 100644 index fdb3ee82baa3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/complete_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CompletionService_CompleteQuery_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the complete_query call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query. -# -def complete_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new - - # Call the complete_query method. - result = client.complete_query request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. - p result -end -# [END discoveryengine_v1_generated_CompletionService_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb deleted file mode 100644 index 1b49f14e488b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_completion_suggestions.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the import_completion_suggestions call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions. -# -def import_completion_suggestions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new - - # Call the import_completion_suggestions method. - result = client.import_completion_suggestions request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb deleted file mode 100644 index f07ad5b71042..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/import_suggestion_deny_list_entries.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the import_suggestion_deny_list_entries call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries. -# -def import_suggestion_deny_list_entries - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new - - # Call the import_suggestion_deny_list_entries method. - result = client.import_suggestion_deny_list_entries request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb deleted file mode 100644 index 7a1cc161fa7f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_completion_suggestions.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the purge_completion_suggestions call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions. -# -def purge_completion_suggestions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new - - # Call the purge_completion_suggestions method. - result = client.purge_completion_suggestions request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb deleted file mode 100644 index 3c93ea0b0cff..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/completion_service/purge_suggestion_deny_list_entries.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the purge_suggestion_deny_list_entries call in the CompletionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries. -# -def purge_suggestion_deny_list_entries - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new - - # Call the purge_suggestion_deny_list_entries method. - result = client.purge_suggestion_deny_list_entries request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb deleted file mode 100644 index c86c2700b384..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/create_control.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ControlService_CreateControl_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control. -# -def create_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new - - # Call the create_control method. - result = client.create_control request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - p result -end -# [END discoveryengine_v1_generated_ControlService_CreateControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb deleted file mode 100644 index e4a1060af977..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/delete_control.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ControlService_DeleteControl_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control. -# -def delete_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new - - # Call the delete_control method. - result = client.delete_control request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END discoveryengine_v1_generated_ControlService_DeleteControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb deleted file mode 100644 index e7185d6584ba..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/get_control.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ControlService_GetControl_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control. -# -def get_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new - - # Call the get_control method. - result = client.get_control request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - p result -end -# [END discoveryengine_v1_generated_ControlService_GetControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb deleted file mode 100644 index 8307266affb9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/list_controls.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ControlService_ListControls_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_controls call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls. -# -def list_controls - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new - - # Call the list_controls method. - result = client.list_controls request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Control. - p item - end -end -# [END discoveryengine_v1_generated_ControlService_ListControls_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb deleted file mode 100644 index 0bb33b6aa06e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/control_service/update_control.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ControlService_UpdateControl_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_control call in the ControlService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control. -# -def update_control - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new - - # Call the update_control method. - result = client.update_control request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. - p result -end -# [END discoveryengine_v1_generated_ControlService_UpdateControl_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb deleted file mode 100644 index b81be0ee2c70..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/answer_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the answer_query call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query. -# -def answer_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - - # Call the answer_query method. - result = client.answer_query request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb deleted file mode 100644 index be914e4b5ad3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/converse_conversation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the converse_conversation call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation. -# -def converse_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new - - # Call the converse_conversation method. - result = client.converse_conversation request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb deleted file mode 100644 index 50b9599f3e81..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_conversation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_conversation call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation. -# -def create_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new - - # Call the create_conversation method. - result = client.create_conversation request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb deleted file mode 100644 index 0ed3dce9bfbc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/create_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_session call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session. -# -def create_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - - # Call the create_session method. - result = client.create_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb deleted file mode 100644 index 423f7b02e0d4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_conversation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_conversation call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation. -# -def delete_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new - - # Call the delete_conversation method. - result = client.delete_conversation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb deleted file mode 100644 index 072f057557d7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/delete_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_session call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session. -# -def delete_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - - # Call the delete_session method. - result = client.delete_session request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb deleted file mode 100644 index 8f900b2fb442..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_answer.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_answer call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer. -# -def get_answer - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new - - # Call the get_answer method. - result = client.get_answer request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb deleted file mode 100644 index a883922f2ed7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_conversation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_conversation call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation. -# -def get_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new - - # Call the get_conversation method. - result = client.get_conversation request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb deleted file mode 100644 index 5733d8ed7b1a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/get_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_session call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session. -# -def get_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - - # Call the get_session method. - result = client.get_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb deleted file mode 100644 index fad72b597cff..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_conversations.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_conversations call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations. -# -def list_conversations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new - - # Call the list_conversations method. - result = client.list_conversations request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. - p item - end -end -# [END discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb deleted file mode 100644 index ccd5a301f826..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/list_sessions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_sessions call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions. -# -def list_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - - # Call the list_sessions method. - result = client.list_sessions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - p item - end -end -# [END discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb deleted file mode 100644 index 1e42431ff85d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/stream_answer_query.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the stream_answer_query call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query. -# -def stream_answer_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new - - # Call the stream_answer_query method to start streaming. - output = client.stream_answer_query request - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse - output.each do |current_response| - p current_response - end -end -# [END discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb deleted file mode 100644 index f82d0851ed5e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_conversation.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_conversation call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation. -# -def update_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new - - # Call the update_conversation method. - result = client.update_conversation request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb deleted file mode 100644 index c3be7879b19a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/conversational_search_service/update_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_session call in the ConversationalSearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session. -# -def update_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - - # Call the update_session method. - result = client.update_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb deleted file mode 100644 index 464291fe665e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/create_data_store.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_data_store call in the DataStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store. -# -def create_data_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new - - # Call the create_data_store method. - result = client.create_data_store request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb deleted file mode 100644 index dba4d66036bb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/delete_data_store.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_data_store call in the DataStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store. -# -def delete_data_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new - - # Call the delete_data_store method. - result = client.delete_data_store request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb deleted file mode 100644 index f1a50c12c943..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/get_data_store.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DataStoreService_GetDataStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_data_store call in the DataStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store. -# -def get_data_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new - - # Call the get_data_store method. - result = client.get_data_store request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - p result -end -# [END discoveryengine_v1_generated_DataStoreService_GetDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb deleted file mode 100644 index 39a3f6f16ed2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/list_data_stores.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DataStoreService_ListDataStores_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_data_stores call in the DataStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores. -# -def list_data_stores - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new - - # Call the list_data_stores method. - result = client.list_data_stores request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore. - p item - end -end -# [END discoveryengine_v1_generated_DataStoreService_ListDataStores_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb deleted file mode 100644 index 2c6fb15de6c2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/data_store_service/update_data_store.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_data_store call in the DataStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store. -# -def update_data_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new - - # Call the update_data_store method. - result = client.update_data_store request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore. - p result -end -# [END discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb deleted file mode 100644 index 9ca373128273..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/batch_get_documents_metadata.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the batch_get_documents_metadata call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata. -# -def batch_get_documents_metadata - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new - - # Call the batch_get_documents_metadata method. - result = client.batch_get_documents_metadata request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse. - p result -end -# [END discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb deleted file mode 100644 index 07003bd16906..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/create_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_CreateDocument_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_document call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document. -# -def create_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new - - # Call the create_document method. - result = client.create_document request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - p result -end -# [END discoveryengine_v1_generated_DocumentService_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb deleted file mode 100644 index 0b4eee511fef..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/delete_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_DeleteDocument_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_document call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document. -# -def delete_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new - - # Call the delete_document method. - result = client.delete_document request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END discoveryengine_v1_generated_DocumentService_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb deleted file mode 100644 index 053245047939..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/get_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_GetDocument_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_document call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document. -# -def get_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new - - # Call the get_document method. - result = client.get_document request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - p result -end -# [END discoveryengine_v1_generated_DocumentService_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb deleted file mode 100644 index 5ed7a5b61275..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/import_documents.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_ImportDocuments_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the import_documents call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents. -# -def import_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new - - # Call the import_documents method. - result = client.import_documents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_DocumentService_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb deleted file mode 100644 index f34642996f84..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/list_documents.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_ListDocuments_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_documents call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents. -# -def list_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new - - # Call the list_documents method. - result = client.list_documents request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. - p item - end -end -# [END discoveryengine_v1_generated_DocumentService_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb deleted file mode 100644 index 5abfe1031312..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/purge_documents.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the purge_documents call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents. -# -def purge_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new - - # Call the purge_documents method. - result = client.purge_documents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb deleted file mode 100644 index b248a2efc5ca..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/document_service/update_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_DocumentService_UpdateDocument_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_document call in the DocumentService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document. -# -def update_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new - - # Call the update_document method. - result = client.update_document request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. - p result -end -# [END discoveryengine_v1_generated_DocumentService_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb deleted file mode 100644 index 0134182dd1fe..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/create_engine.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_EngineService_CreateEngine_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_engine call in the EngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine. -# -def create_engine - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new - - # Call the create_engine method. - result = client.create_engine request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_EngineService_CreateEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb deleted file mode 100644 index b0e453601e3b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/delete_engine.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_EngineService_DeleteEngine_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_engine call in the EngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine. -# -def delete_engine - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new - - # Call the delete_engine method. - result = client.delete_engine request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_EngineService_DeleteEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb deleted file mode 100644 index ee5db2f66986..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/get_engine.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_EngineService_GetEngine_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_engine call in the EngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine. -# -def get_engine - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new - - # Call the get_engine method. - result = client.get_engine request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - p result -end -# [END discoveryengine_v1_generated_EngineService_GetEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb deleted file mode 100644 index b07b445b88e7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/list_engines.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_EngineService_ListEngines_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_engines call in the EngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines. -# -def list_engines - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new - - # Call the list_engines method. - result = client.list_engines request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Engine. - p item - end -end -# [END discoveryengine_v1_generated_EngineService_ListEngines_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb deleted file mode 100644 index 5a9350054710..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/engine_service/update_engine.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_EngineService_UpdateEngine_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_engine call in the EngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine. -# -def update_engine - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new - - # Call the update_engine method. - result = client.update_engine request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Engine. - p result -end -# [END discoveryengine_v1_generated_EngineService_UpdateEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb deleted file mode 100644 index 0439610ef869..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/check_grounding.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the check_grounding call in the GroundedGenerationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding. -# -def check_grounding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new - - # Call the check_grounding method. - result = client.check_grounding request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse. - p result -end -# [END discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb deleted file mode 100644 index 566065b34e7d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/generate_grounded_content.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the generate_grounded_content call in the GroundedGenerationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content. -# -def generate_grounded_content - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - - # Call the generate_grounded_content method. - result = client.generate_grounded_content request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse. - p result -end -# [END discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb deleted file mode 100644 index 62695d2e251a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/grounded_generation_service/stream_generate_grounded_content.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the stream_generate_grounded_content call in the GroundedGenerationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content. -# -def stream_generate_grounded_content - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the stream_generate_grounded_content method to start streaming. - output = client.stream_generate_grounded_content input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - input << Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse - output.each do |current_response| - p current_response - end -end -# [END discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb deleted file mode 100644 index 76b5a3a559be..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/create_identity_mapping_store.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_identity_mapping_store call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store. -# -def create_identity_mapping_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new - - # Call the create_identity_mapping_store method. - result = client.create_identity_mapping_store request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - p result -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb deleted file mode 100644 index 455bdc992508..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/delete_identity_mapping_store.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_identity_mapping_store call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store. -# -def delete_identity_mapping_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new - - # Call the delete_identity_mapping_store method. - result = client.delete_identity_mapping_store request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb deleted file mode 100644 index 71a1c0f15081..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/get_identity_mapping_store.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_identity_mapping_store call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store. -# -def get_identity_mapping_store - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new - - # Call the get_identity_mapping_store method. - result = client.get_identity_mapping_store request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - p result -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb deleted file mode 100644 index 2f8b469f72a6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/import_identity_mappings.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the import_identity_mappings call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings. -# -def import_identity_mappings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new - - # Call the import_identity_mappings method. - result = client.import_identity_mappings request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb deleted file mode 100644 index 8020429b17a4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mapping_stores.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_identity_mapping_stores call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores. -# -def list_identity_mapping_stores - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new - - # Call the list_identity_mapping_stores method. - result = client.list_identity_mapping_stores request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore. - p item - end -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb deleted file mode 100644 index 49d0549d3e11..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/list_identity_mappings.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_identity_mappings call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings. -# -def list_identity_mappings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new - - # Call the list_identity_mappings method. - result = client.list_identity_mappings request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingEntry. - p item - end -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb deleted file mode 100644 index efea280f90e0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/identity_mapping_store_service/purge_identity_mappings.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the purge_identity_mappings call in the IdentityMappingStoreService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings. -# -def purge_identity_mappings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new - - # Call the purge_identity_mappings method. - result = client.purge_identity_mappings request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb deleted file mode 100644 index fccf226e1812..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/project_service/provision_project.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ProjectService_ProvisionProject_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the provision_project call in the ProjectService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project. -# -def provision_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new - - # Call the provision_project method. - result = client.provision_project request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_ProjectService_ProvisionProject_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb deleted file mode 100644 index e46fc58ed78b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/rank_service/rank.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_RankService_Rank_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the rank call in the RankService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank. -# -def rank - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::RankService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::RankRequest.new - - # Call the rank method. - result = client.rank request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RankResponse. - p result -end -# [END discoveryengine_v1_generated_RankService_Rank_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb deleted file mode 100644 index 535c51ab222c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/recommendation_service/recommend.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_RecommendationService_Recommend_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the recommend call in the RecommendationService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend. -# -def recommend - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new - - # Call the recommend method. - result = client.recommend request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::RecommendResponse. - p result -end -# [END discoveryengine_v1_generated_RecommendationService_Recommend_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb deleted file mode 100644 index 57f6fbb56b84..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/create_schema.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SchemaService_CreateSchema_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema. -# -def create_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new - - # Call the create_schema method. - result = client.create_schema request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SchemaService_CreateSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb deleted file mode 100644 index d6fcc2cbc50a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/delete_schema.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SchemaService_DeleteSchema_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema. -# -def delete_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new - - # Call the delete_schema method. - result = client.delete_schema request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb deleted file mode 100644 index be5145e3a025..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/get_schema.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SchemaService_GetSchema_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema. -# -def get_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new - - # Call the get_schema method. - result = client.get_schema request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. - p result -end -# [END discoveryengine_v1_generated_SchemaService_GetSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb deleted file mode 100644 index 94b9d4fe73cc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/list_schemas.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SchemaService_ListSchemas_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_schemas call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas. -# -def list_schemas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new - - # Call the list_schemas method. - result = client.list_schemas request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. - p item - end -end -# [END discoveryengine_v1_generated_SchemaService_ListSchemas_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb deleted file mode 100644 index c56df671712e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/schema_service/update_schema.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SchemaService_UpdateSchema_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_schema call in the SchemaService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema. -# -def update_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new - - # Call the update_schema method. - result = client.update_schema request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SchemaService_UpdateSchema_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb deleted file mode 100644 index b8cbadac99e8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SearchService_Search_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the search call in the SearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search. -# -def search - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - - # Call the search method. - result = client.search request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - p item - end -end -# [END discoveryengine_v1_generated_SearchService_Search_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb deleted file mode 100644 index 8266197679b0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_service/search_lite.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SearchService_SearchLite_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the search_lite call in the SearchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite. -# -def search_lite - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new - - # Call the search_lite method. - result = client.search_lite request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. - p item - end -end -# [END discoveryengine_v1_generated_SearchService_SearchLite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb deleted file mode 100644 index 8c0d99061206..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/list_custom_models.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_custom_models call in the SearchTuningService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models. -# -def list_custom_models - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new - - # Call the list_custom_models method. - result = client.list_custom_models request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse. - p result -end -# [END discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb deleted file mode 100644 index 64e56ece4a1f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/search_tuning_service/train_custom_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the train_custom_model call in the SearchTuningService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model. -# -def train_custom_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new - - # Call the train_custom_model method. - result = client.train_custom_model request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb deleted file mode 100644 index 347761a4bf51..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/serving_config_service/update_serving_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_serving_config call in the ServingConfigService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config. -# -def update_serving_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new - - # Call the update_serving_config method. - result = client.update_serving_config request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ServingConfig. - p result -end -# [END discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb deleted file mode 100644 index 9df455d26df6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/create_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SessionService_CreateSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_session call in the SessionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session. -# -def create_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new - - # Call the create_session method. - result = client.create_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_SessionService_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb deleted file mode 100644 index 399efe09ac18..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/delete_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SessionService_DeleteSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_session call in the SessionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session. -# -def delete_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new - - # Call the delete_session method. - result = client.delete_session request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END discoveryengine_v1_generated_SessionService_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb deleted file mode 100644 index f9205279fe2c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/get_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SessionService_GetSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_session call in the SessionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session. -# -def get_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new - - # Call the get_session method. - result = client.get_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_SessionService_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb deleted file mode 100644 index 0a47314c1dd1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/list_sessions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SessionService_ListSessions_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_sessions call in the SessionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions. -# -def list_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new - - # Call the list_sessions method. - result = client.list_sessions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session. - p item - end -end -# [END discoveryengine_v1_generated_SessionService_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb deleted file mode 100644 index 8ca24577692e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/session_service/update_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SessionService_UpdateSession_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_session call in the SessionService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session. -# -def update_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new - - # Call the update_session method. - result = client.update_session request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session. - p result -end -# [END discoveryengine_v1_generated_SessionService_UpdateSession_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb deleted file mode 100644 index 1f16fd4bc426..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_create_target_sites.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the batch_create_target_sites call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites. -# -def batch_create_target_sites - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new - - # Call the batch_create_target_sites method. - result = client.batch_create_target_sites request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb deleted file mode 100644 index 7b79d8287f49..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/batch_verify_target_sites.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the batch_verify_target_sites call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites. -# -def batch_verify_target_sites - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new - - # Call the batch_verify_target_sites method. - result = client.batch_verify_target_sites request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb deleted file mode 100644 index 7fd5daab55cf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_sitemap.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_sitemap call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap. -# -def create_sitemap - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new - - # Call the create_sitemap method. - result = client.create_sitemap request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb deleted file mode 100644 index e4a281c90ea8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/create_target_site.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the create_target_site call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site. -# -def create_target_site - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new - - # Call the create_target_site method. - result = client.create_target_site request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb deleted file mode 100644 index c1c309f33676..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_sitemap.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_sitemap call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap. -# -def delete_sitemap - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new - - # Call the delete_sitemap method. - result = client.delete_sitemap request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb deleted file mode 100644 index 9fe17da161ec..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/delete_target_site.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the delete_target_site call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site. -# -def delete_target_site - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new - - # Call the delete_target_site method. - result = client.delete_target_site request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb deleted file mode 100644 index 89b9cfb78997..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/disable_advanced_site_search.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the disable_advanced_site_search call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search. -# -def disable_advanced_site_search - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new - - # Call the disable_advanced_site_search method. - result = client.disable_advanced_site_search request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb deleted file mode 100644 index 2ba8a6a76192..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/enable_advanced_site_search.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the enable_advanced_site_search call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search. -# -def enable_advanced_site_search - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new - - # Call the enable_advanced_site_search method. - result = client.enable_advanced_site_search request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb deleted file mode 100644 index a184d8259d7d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_domain_verification_status.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the fetch_domain_verification_status call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status. -# -def fetch_domain_verification_status - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new - - # Call the fetch_domain_verification_status method. - result = client.fetch_domain_verification_status request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - p item - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb deleted file mode 100644 index a7a736ef6cd6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/fetch_sitemaps.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the fetch_sitemaps call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps. -# -def fetch_sitemaps - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new - - # Call the fetch_sitemaps method. - result = client.fetch_sitemaps request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse. - p result -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb deleted file mode 100644 index 576aae43eefc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_site_search_engine.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_site_search_engine call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine. -# -def get_site_search_engine - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new - - # Call the get_site_search_engine method. - result = client.get_site_search_engine request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine. - p result -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb deleted file mode 100644 index 691157f6171a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/get_target_site.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the get_target_site call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site. -# -def get_target_site - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new - - # Call the get_target_site method. - result = client.get_target_site request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::TargetSite. - p result -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb deleted file mode 100644 index 5b166d63dfbf..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/list_target_sites.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_target_sites call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites. -# -def list_target_sites - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new - - # Call the list_target_sites method. - result = client.list_target_sites request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::TargetSite. - p item - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb deleted file mode 100644 index ef6d692d5af0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/recrawl_uris.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the recrawl_uris call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris. -# -def recrawl_uris - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new - - # Call the recrawl_uris method. - result = client.recrawl_uris request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb deleted file mode 100644 index 47b5006c002c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/site_search_engine_service/update_target_site.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the update_target_site call in the SiteSearchEngineService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site. -# -def update_target_site - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new - - # Call the update_target_site method. - result = client.update_target_site request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json deleted file mode 100644 index be976f34aae1..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/snippet_metadata_google.cloud.discoveryengine.v1.json +++ /dev/null @@ -1,3855 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-discovery_engine-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.discoveryengine.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "discoveryengine_v1_generated_SearchService_Search_sync", - "title": "Snippet for the search call in the SearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search.", - "file": "search_service/search.rb", - "language": "RUBY", - "client_method": { - "short_name": "search", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::SearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::SearchResponse", - "client": { - "short_name": "SearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client" - }, - "method": { - "short_name": "Search", - "full_name": "google.cloud.discoveryengine.v1.SearchService.Search", - "service": { - "short_name": "SearchService", - "full_name": "google.cloud.discoveryengine.v1.SearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SearchService_SearchLite_sync", - "title": "Snippet for the search_lite call in the SearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite.", - "file": "search_service/search_lite.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_lite", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client#search_lite", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::SearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::SearchResponse", - "client": { - "short_name": "SearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchService::Client" - }, - "method": { - "short_name": "SearchLite", - "full_name": "google.cloud.discoveryengine.v1.SearchService.SearchLite", - "service": { - "short_name": "SearchService", - "full_name": "google.cloud.discoveryengine.v1.SearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_AssistantService_StreamAssist_sync", - "title": "Snippet for the stream_assist call in the AssistantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist.", - "file": "assistant_service/stream_assist.rb", - "language": "RUBY", - "client_method": { - "short_name": "stream_assist", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client#stream_assist", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse", - "client": { - "short_name": "AssistantService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client" - }, - "method": { - "short_name": "StreamAssist", - "full_name": "google.cloud.discoveryengine.v1.AssistantService.StreamAssist", - "service": { - "short_name": "AssistantService", - "full_name": "google.cloud.discoveryengine.v1.AssistantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CmekConfigService_UpdateCmekConfig_sync", - "title": "Snippet for the update_cmek_config call in the CmekConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config.", - "file": "cmek_config_service/update_cmek_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cmek_config", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#update_cmek_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CmekConfigService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" - }, - "method": { - "short_name": "UpdateCmekConfig", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.UpdateCmekConfig", - "service": { - "short_name": "CmekConfigService", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CmekConfigService_GetCmekConfig_sync", - "title": "Snippet for the get_cmek_config call in the CmekConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config.", - "file": "cmek_config_service/get_cmek_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cmek_config", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#get_cmek_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::CmekConfig", - "client": { - "short_name": "CmekConfigService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" - }, - "method": { - "short_name": "GetCmekConfig", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.GetCmekConfig", - "service": { - "short_name": "CmekConfigService", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CmekConfigService_ListCmekConfigs_sync", - "title": "Snippet for the list_cmek_configs call in the CmekConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs.", - "file": "cmek_config_service/list_cmek_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_cmek_configs", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#list_cmek_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse", - "client": { - "short_name": "CmekConfigService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" - }, - "method": { - "short_name": "ListCmekConfigs", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.ListCmekConfigs", - "service": { - "short_name": "CmekConfigService", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CmekConfigService_DeleteCmekConfig_sync", - "title": "Snippet for the delete_cmek_config call in the CmekConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config.", - "file": "cmek_config_service/delete_cmek_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cmek_config", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client#delete_cmek_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CmekConfigService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client" - }, - "method": { - "short_name": "DeleteCmekConfig", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService.DeleteCmekConfig", - "service": { - "short_name": "CmekConfigService", - "full_name": "google.cloud.discoveryengine.v1.CmekConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CompletionService_CompleteQuery_sync", - "title": "Snippet for the complete_query call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query.", - "file": "completion_service/complete_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_query", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#complete_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" - }, - "method": { - "short_name": "CompleteQuery", - "full_name": "google.cloud.discoveryengine.v1.CompletionService.CompleteQuery", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.discoveryengine.v1.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CompletionService_ImportSuggestionDenyListEntries_sync", - "title": "Snippet for the import_suggestion_deny_list_entries call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries.", - "file": "completion_service/import_suggestion_deny_list_entries.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_suggestion_deny_list_entries", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_suggestion_deny_list_entries", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" - }, - "method": { - "short_name": "ImportSuggestionDenyListEntries", - "full_name": "google.cloud.discoveryengine.v1.CompletionService.ImportSuggestionDenyListEntries", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.discoveryengine.v1.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CompletionService_PurgeSuggestionDenyListEntries_sync", - "title": "Snippet for the purge_suggestion_deny_list_entries call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries.", - "file": "completion_service/purge_suggestion_deny_list_entries.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_suggestion_deny_list_entries", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_suggestion_deny_list_entries", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" - }, - "method": { - "short_name": "PurgeSuggestionDenyListEntries", - "full_name": "google.cloud.discoveryengine.v1.CompletionService.PurgeSuggestionDenyListEntries", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.discoveryengine.v1.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CompletionService_ImportCompletionSuggestions_sync", - "title": "Snippet for the import_completion_suggestions call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions.", - "file": "completion_service/import_completion_suggestions.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_completion_suggestions", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#import_completion_suggestions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" - }, - "method": { - "short_name": "ImportCompletionSuggestions", - "full_name": "google.cloud.discoveryengine.v1.CompletionService.ImportCompletionSuggestions", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.discoveryengine.v1.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_CompletionService_PurgeCompletionSuggestions_sync", - "title": "Snippet for the purge_completion_suggestions call in the CompletionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions.", - "file": "completion_service/purge_completion_suggestions.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_completion_suggestions", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client#purge_completion_suggestions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "CompletionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client" - }, - "method": { - "short_name": "PurgeCompletionSuggestions", - "full_name": "google.cloud.discoveryengine.v1.CompletionService.PurgeCompletionSuggestions", - "service": { - "short_name": "CompletionService", - "full_name": "google.cloud.discoveryengine.v1.CompletionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ControlService_CreateControl_sync", - "title": "Snippet for the create_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control.", - "file": "control_service/create_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_control", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#create_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" - }, - "method": { - "short_name": "CreateControl", - "full_name": "google.cloud.discoveryengine.v1.ControlService.CreateControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.discoveryengine.v1.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ControlService_DeleteControl_sync", - "title": "Snippet for the delete_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control.", - "file": "control_service/delete_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_control", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#delete_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" - }, - "method": { - "short_name": "DeleteControl", - "full_name": "google.cloud.discoveryengine.v1.ControlService.DeleteControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.discoveryengine.v1.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ControlService_UpdateControl_sync", - "title": "Snippet for the update_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control.", - "file": "control_service/update_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_control", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#update_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" - }, - "method": { - "short_name": "UpdateControl", - "full_name": "google.cloud.discoveryengine.v1.ControlService.UpdateControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.discoveryengine.v1.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ControlService_GetControl_sync", - "title": "Snippet for the get_control call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control.", - "file": "control_service/get_control.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_control", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#get_control", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetControlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Control", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" - }, - "method": { - "short_name": "GetControl", - "full_name": "google.cloud.discoveryengine.v1.ControlService.GetControl", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.discoveryengine.v1.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ControlService_ListControls_sync", - "title": "Snippet for the list_controls call in the ControlService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls.", - "file": "control_service/list_controls.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_controls", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client#list_controls", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse", - "client": { - "short_name": "ControlService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ControlService::Client" - }, - "method": { - "short_name": "ListControls", - "full_name": "google.cloud.discoveryengine.v1.ControlService.ListControls", - "service": { - "short_name": "ControlService", - "full_name": "google.cloud.discoveryengine.v1.ControlService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ConverseConversation_sync", - "title": "Snippet for the converse_conversation call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation.", - "file": "conversational_search_service/converse_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "converse_conversation", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#converse_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "ConverseConversation", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ConverseConversation", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_CreateConversation_sync", - "title": "Snippet for the create_conversation call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation.", - "file": "conversational_search_service/create_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "CreateConversation", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.CreateConversation", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_DeleteConversation_sync", - "title": "Snippet for the delete_conversation call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation.", - "file": "conversational_search_service/delete_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_conversation", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "DeleteConversation", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.DeleteConversation", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_UpdateConversation_sync", - "title": "Snippet for the update_conversation call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation.", - "file": "conversational_search_service/update_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_conversation", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "UpdateConversation", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.UpdateConversation", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetConversation_sync", - "title": "Snippet for the get_conversation call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation.", - "file": "conversational_search_service/get_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Conversation", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "GetConversation", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetConversation", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ListConversations_sync", - "title": "Snippet for the list_conversations call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations.", - "file": "conversational_search_service/list_conversations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversations", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_conversations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "ListConversations", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ListConversations", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_AnswerQuery_sync", - "title": "Snippet for the answer_query call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query.", - "file": "conversational_search_service/answer_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "answer_query", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#answer_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "AnswerQuery", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.AnswerQuery", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_StreamAnswerQuery_sync", - "title": "Snippet for the stream_answer_query call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query.", - "file": "conversational_search_service/stream_answer_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "stream_answer_query", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#stream_answer_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "StreamAnswerQuery", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.StreamAnswerQuery", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 49, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetAnswer_sync", - "title": "Snippet for the get_answer call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer.", - "file": "conversational_search_service/get_answer.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_answer", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Answer", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "GetAnswer", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_CreateSession_sync", - "title": "Snippet for the create_session call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session.", - "file": "conversational_search_service/create_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#create_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "CreateSession", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.CreateSession", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_DeleteSession_sync", - "title": "Snippet for the delete_session call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session.", - "file": "conversational_search_service/delete_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#delete_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "DeleteSession", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.DeleteSession", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_UpdateSession_sync", - "title": "Snippet for the update_session call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session.", - "file": "conversational_search_service/update_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#update_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "UpdateSession", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.UpdateSession", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_GetSession_sync", - "title": "Snippet for the get_session call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session.", - "file": "conversational_search_service/get_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "GetSession", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ConversationalSearchService_ListSessions_sync", - "title": "Snippet for the list_sessions call in the ConversationalSearchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions.", - "file": "conversational_search_service/list_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sessions", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#list_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse", - "client": { - "short_name": "ConversationalSearchService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client" - }, - "method": { - "short_name": "ListSessions", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService.ListSessions", - "service": { - "short_name": "ConversationalSearchService", - "full_name": "google.cloud.discoveryengine.v1.ConversationalSearchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DataStoreService_CreateDataStore_sync", - "title": "Snippet for the create_data_store call in the DataStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store.", - "file": "data_store_service/create_data_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_data_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DataStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" - }, - "method": { - "short_name": "CreateDataStore", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService.CreateDataStore", - "service": { - "short_name": "DataStoreService", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DataStoreService_GetDataStore_sync", - "title": "Snippet for the get_data_store call in the DataStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store.", - "file": "data_store_service/get_data_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_data_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#get_data_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::DataStore", - "client": { - "short_name": "DataStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" - }, - "method": { - "short_name": "GetDataStore", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService.GetDataStore", - "service": { - "short_name": "DataStoreService", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DataStoreService_ListDataStores_sync", - "title": "Snippet for the list_data_stores call in the DataStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores.", - "file": "data_store_service/list_data_stores.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_data_stores", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse", - "client": { - "short_name": "DataStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" - }, - "method": { - "short_name": "ListDataStores", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService.ListDataStores", - "service": { - "short_name": "DataStoreService", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DataStoreService_DeleteDataStore_sync", - "title": "Snippet for the delete_data_store call in the DataStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store.", - "file": "data_store_service/delete_data_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_data_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#delete_data_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DataStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" - }, - "method": { - "short_name": "DeleteDataStore", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService.DeleteDataStore", - "service": { - "short_name": "DataStoreService", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DataStoreService_UpdateDataStore_sync", - "title": "Snippet for the update_data_store call in the DataStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store.", - "file": "data_store_service/update_data_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_data_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#update_data_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::DataStore", - "client": { - "short_name": "DataStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client" - }, - "method": { - "short_name": "UpdateDataStore", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService.UpdateDataStore", - "service": { - "short_name": "DataStoreService", - "full_name": "google.cloud.discoveryengine.v1.DataStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_GetDocument_sync", - "title": "Snippet for the get_document call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document.", - "file": "document_service/get_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_document", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#get_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "GetDocument", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.GetDocument", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_ListDocuments_sync", - "title": "Snippet for the list_documents call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents.", - "file": "document_service/list_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_documents", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#list_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "ListDocuments", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.ListDocuments", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_CreateDocument_sync", - "title": "Snippet for the create_document call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document.", - "file": "document_service/create_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_document", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#create_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "CreateDocument", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.CreateDocument", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_UpdateDocument_sync", - "title": "Snippet for the update_document call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document.", - "file": "document_service/update_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_document", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#update_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Document", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "UpdateDocument", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.UpdateDocument", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_DeleteDocument_sync", - "title": "Snippet for the delete_document call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document.", - "file": "document_service/delete_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_document", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#delete_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "DeleteDocument", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.DeleteDocument", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_ImportDocuments_sync", - "title": "Snippet for the import_documents call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents.", - "file": "document_service/import_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_documents", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "ImportDocuments", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.ImportDocuments", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_PurgeDocuments_sync", - "title": "Snippet for the purge_documents call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents.", - "file": "document_service/purge_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_documents", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#purge_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "PurgeDocuments", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.PurgeDocuments", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_DocumentService_BatchGetDocumentsMetadata_sync", - "title": "Snippet for the batch_get_documents_metadata call in the DocumentService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata.", - "file": "document_service/batch_get_documents_metadata.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_get_documents_metadata", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#batch_get_documents_metadata", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse", - "client": { - "short_name": "DocumentService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client" - }, - "method": { - "short_name": "BatchGetDocumentsMetadata", - "full_name": "google.cloud.discoveryengine.v1.DocumentService.BatchGetDocumentsMetadata", - "service": { - "short_name": "DocumentService", - "full_name": "google.cloud.discoveryengine.v1.DocumentService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_EngineService_CreateEngine_sync", - "title": "Snippet for the create_engine call in the EngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine.", - "file": "engine_service/create_engine.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_engine", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#create_engine", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" - }, - "method": { - "short_name": "CreateEngine", - "full_name": "google.cloud.discoveryengine.v1.EngineService.CreateEngine", - "service": { - "short_name": "EngineService", - "full_name": "google.cloud.discoveryengine.v1.EngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_EngineService_DeleteEngine_sync", - "title": "Snippet for the delete_engine call in the EngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine.", - "file": "engine_service/delete_engine.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_engine", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#delete_engine", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" - }, - "method": { - "short_name": "DeleteEngine", - "full_name": "google.cloud.discoveryengine.v1.EngineService.DeleteEngine", - "service": { - "short_name": "EngineService", - "full_name": "google.cloud.discoveryengine.v1.EngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_EngineService_UpdateEngine_sync", - "title": "Snippet for the update_engine call in the EngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine.", - "file": "engine_service/update_engine.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_engine", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#update_engine", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Engine", - "client": { - "short_name": "EngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" - }, - "method": { - "short_name": "UpdateEngine", - "full_name": "google.cloud.discoveryengine.v1.EngineService.UpdateEngine", - "service": { - "short_name": "EngineService", - "full_name": "google.cloud.discoveryengine.v1.EngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_EngineService_GetEngine_sync", - "title": "Snippet for the get_engine call in the EngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine.", - "file": "engine_service/get_engine.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_engine", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#get_engine", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Engine", - "client": { - "short_name": "EngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" - }, - "method": { - "short_name": "GetEngine", - "full_name": "google.cloud.discoveryengine.v1.EngineService.GetEngine", - "service": { - "short_name": "EngineService", - "full_name": "google.cloud.discoveryengine.v1.EngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_EngineService_ListEngines_sync", - "title": "Snippet for the list_engines call in the EngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines.", - "file": "engine_service/list_engines.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_engines", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client#list_engines", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse", - "client": { - "short_name": "EngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::EngineService::Client" - }, - "method": { - "short_name": "ListEngines", - "full_name": "google.cloud.discoveryengine.v1.EngineService.ListEngines", - "service": { - "short_name": "EngineService", - "full_name": "google.cloud.discoveryengine.v1.EngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_StreamGenerateGroundedContent_sync", - "title": "Snippet for the stream_generate_grounded_content call in the GroundedGenerationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content.", - "file": "grounded_generation_service/stream_generate_grounded_content.rb", - "language": "RUBY", - "client_method": { - "short_name": "stream_generate_grounded_content", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#stream_generate_grounded_content", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse", - "client": { - "short_name": "GroundedGenerationService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" - }, - "method": { - "short_name": "StreamGenerateGroundedContent", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.StreamGenerateGroundedContent", - "service": { - "short_name": "GroundedGenerationService", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_GenerateGroundedContent_sync", - "title": "Snippet for the generate_grounded_content call in the GroundedGenerationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content.", - "file": "grounded_generation_service/generate_grounded_content.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_grounded_content", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#generate_grounded_content", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse", - "client": { - "short_name": "GroundedGenerationService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" - }, - "method": { - "short_name": "GenerateGroundedContent", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.GenerateGroundedContent", - "service": { - "short_name": "GroundedGenerationService", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_GroundedGenerationService_CheckGrounding_sync", - "title": "Snippet for the check_grounding call in the GroundedGenerationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding.", - "file": "grounded_generation_service/check_grounding.rb", - "language": "RUBY", - "client_method": { - "short_name": "check_grounding", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client#check_grounding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse", - "client": { - "short_name": "GroundedGenerationService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client" - }, - "method": { - "short_name": "CheckGrounding", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService.CheckGrounding", - "service": { - "short_name": "GroundedGenerationService", - "full_name": "google.cloud.discoveryengine.v1.GroundedGenerationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_CreateIdentityMappingStore_sync", - "title": "Snippet for the create_identity_mapping_store call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store.", - "file": "identity_mapping_store_service/create_identity_mapping_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_identity_mapping_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#create_identity_mapping_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "CreateIdentityMappingStore", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.CreateIdentityMappingStore", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_GetIdentityMappingStore_sync", - "title": "Snippet for the get_identity_mapping_store call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store.", - "file": "identity_mapping_store_service/get_identity_mapping_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_identity_mapping_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#get_identity_mapping_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "GetIdentityMappingStore", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.GetIdentityMappingStore", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_DeleteIdentityMappingStore_sync", - "title": "Snippet for the delete_identity_mapping_store call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store.", - "file": "identity_mapping_store_service/delete_identity_mapping_store.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_identity_mapping_store", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#delete_identity_mapping_store", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "DeleteIdentityMappingStore", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.DeleteIdentityMappingStore", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ImportIdentityMappings_sync", - "title": "Snippet for the import_identity_mappings call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings.", - "file": "identity_mapping_store_service/import_identity_mappings.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_identity_mappings", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#import_identity_mappings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "ImportIdentityMappings", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ImportIdentityMappings", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_PurgeIdentityMappings_sync", - "title": "Snippet for the purge_identity_mappings call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings.", - "file": "identity_mapping_store_service/purge_identity_mappings.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_identity_mappings", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#purge_identity_mappings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "PurgeIdentityMappings", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.PurgeIdentityMappings", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappings_sync", - "title": "Snippet for the list_identity_mappings call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings.", - "file": "identity_mapping_store_service/list_identity_mappings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_identity_mappings", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mappings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "ListIdentityMappings", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ListIdentityMappings", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_IdentityMappingStoreService_ListIdentityMappingStores_sync", - "title": "Snippet for the list_identity_mapping_stores call in the IdentityMappingStoreService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores.", - "file": "identity_mapping_store_service/list_identity_mapping_stores.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_identity_mapping_stores", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client#list_identity_mapping_stores", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse", - "client": { - "short_name": "IdentityMappingStoreService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client" - }, - "method": { - "short_name": "ListIdentityMappingStores", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService.ListIdentityMappingStores", - "service": { - "short_name": "IdentityMappingStoreService", - "full_name": "google.cloud.discoveryengine.v1.IdentityMappingStoreService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ProjectService_ProvisionProject_sync", - "title": "Snippet for the provision_project call in the ProjectService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project.", - "file": "project_service/provision_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "provision_project", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client#provision_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProjectService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client" - }, - "method": { - "short_name": "ProvisionProject", - "full_name": "google.cloud.discoveryengine.v1.ProjectService.ProvisionProject", - "service": { - "short_name": "ProjectService", - "full_name": "google.cloud.discoveryengine.v1.ProjectService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_RankService_Rank_sync", - "title": "Snippet for the rank call in the RankService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank.", - "file": "rank_service/rank.rb", - "language": "RUBY", - "client_method": { - "short_name": "rank", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client#rank", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::RankRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::RankResponse", - "client": { - "short_name": "RankService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::RankService::Client" - }, - "method": { - "short_name": "Rank", - "full_name": "google.cloud.discoveryengine.v1.RankService.Rank", - "service": { - "short_name": "RankService", - "full_name": "google.cloud.discoveryengine.v1.RankService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_RecommendationService_Recommend_sync", - "title": "Snippet for the recommend call in the RecommendationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend.", - "file": "recommendation_service/recommend.rb", - "language": "RUBY", - "client_method": { - "short_name": "recommend", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client#recommend", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::RecommendRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::RecommendResponse", - "client": { - "short_name": "RecommendationService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client" - }, - "method": { - "short_name": "Recommend", - "full_name": "google.cloud.discoveryengine.v1.RecommendationService.Recommend", - "service": { - "short_name": "RecommendationService", - "full_name": "google.cloud.discoveryengine.v1.RecommendationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SchemaService_GetSchema_sync", - "title": "Snippet for the get_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema.", - "file": "schema_service/get_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_schema", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#get_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Schema", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" - }, - "method": { - "short_name": "GetSchema", - "full_name": "google.cloud.discoveryengine.v1.SchemaService.GetSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.cloud.discoveryengine.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SchemaService_ListSchemas_sync", - "title": "Snippet for the list_schemas call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas.", - "file": "schema_service/list_schemas.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_schemas", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#list_schemas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" - }, - "method": { - "short_name": "ListSchemas", - "full_name": "google.cloud.discoveryengine.v1.SchemaService.ListSchemas", - "service": { - "short_name": "SchemaService", - "full_name": "google.cloud.discoveryengine.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SchemaService_CreateSchema_sync", - "title": "Snippet for the create_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema.", - "file": "schema_service/create_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_schema", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#create_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" - }, - "method": { - "short_name": "CreateSchema", - "full_name": "google.cloud.discoveryengine.v1.SchemaService.CreateSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.cloud.discoveryengine.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SchemaService_UpdateSchema_sync", - "title": "Snippet for the update_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema.", - "file": "schema_service/update_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_schema", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#update_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" - }, - "method": { - "short_name": "UpdateSchema", - "full_name": "google.cloud.discoveryengine.v1.SchemaService.UpdateSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.cloud.discoveryengine.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SchemaService_DeleteSchema_sync", - "title": "Snippet for the delete_schema call in the SchemaService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema.", - "file": "schema_service/delete_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_schema", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client#delete_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SchemaService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client" - }, - "method": { - "short_name": "DeleteSchema", - "full_name": "google.cloud.discoveryengine.v1.SchemaService.DeleteSchema", - "service": { - "short_name": "SchemaService", - "full_name": "google.cloud.discoveryengine.v1.SchemaService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SearchTuningService_TrainCustomModel_sync", - "title": "Snippet for the train_custom_model call in the SearchTuningService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model.", - "file": "search_tuning_service/train_custom_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_custom_model", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#train_custom_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SearchTuningService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client" - }, - "method": { - "short_name": "TrainCustomModel", - "full_name": "google.cloud.discoveryengine.v1.SearchTuningService.TrainCustomModel", - "service": { - "short_name": "SearchTuningService", - "full_name": "google.cloud.discoveryengine.v1.SearchTuningService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SearchTuningService_ListCustomModels_sync", - "title": "Snippet for the list_custom_models call in the SearchTuningService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models.", - "file": "search_tuning_service/list_custom_models.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_models", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client#list_custom_models", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse", - "client": { - "short_name": "SearchTuningService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client" - }, - "method": { - "short_name": "ListCustomModels", - "full_name": "google.cloud.discoveryengine.v1.SearchTuningService.ListCustomModels", - "service": { - "short_name": "SearchTuningService", - "full_name": "google.cloud.discoveryengine.v1.SearchTuningService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_ServingConfigService_UpdateServingConfig_sync", - "title": "Snippet for the update_serving_config call in the ServingConfigService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config.", - "file": "serving_config_service/update_serving_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_serving_config", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client#update_serving_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ServingConfig", - "client": { - "short_name": "ServingConfigService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client" - }, - "method": { - "short_name": "UpdateServingConfig", - "full_name": "google.cloud.discoveryengine.v1.ServingConfigService.UpdateServingConfig", - "service": { - "short_name": "ServingConfigService", - "full_name": "google.cloud.discoveryengine.v1.ServingConfigService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SessionService_CreateSession_sync", - "title": "Snippet for the create_session call in the SessionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session.", - "file": "session_service/create_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#create_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "SessionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" - }, - "method": { - "short_name": "CreateSession", - "full_name": "google.cloud.discoveryengine.v1.SessionService.CreateSession", - "service": { - "short_name": "SessionService", - "full_name": "google.cloud.discoveryengine.v1.SessionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SessionService_DeleteSession_sync", - "title": "Snippet for the delete_session call in the SessionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session.", - "file": "session_service/delete_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#delete_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SessionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" - }, - "method": { - "short_name": "DeleteSession", - "full_name": "google.cloud.discoveryengine.v1.SessionService.DeleteSession", - "service": { - "short_name": "SessionService", - "full_name": "google.cloud.discoveryengine.v1.SessionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SessionService_UpdateSession_sync", - "title": "Snippet for the update_session call in the SessionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session.", - "file": "session_service/update_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#update_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "SessionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" - }, - "method": { - "short_name": "UpdateSession", - "full_name": "google.cloud.discoveryengine.v1.SessionService.UpdateSession", - "service": { - "short_name": "SessionService", - "full_name": "google.cloud.discoveryengine.v1.SessionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SessionService_GetSession_sync", - "title": "Snippet for the get_session call in the SessionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session.", - "file": "session_service/get_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#get_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::Session", - "client": { - "short_name": "SessionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" - }, - "method": { - "short_name": "GetSession", - "full_name": "google.cloud.discoveryengine.v1.SessionService.GetSession", - "service": { - "short_name": "SessionService", - "full_name": "google.cloud.discoveryengine.v1.SessionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SessionService_ListSessions_sync", - "title": "Snippet for the list_sessions call in the SessionService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions.", - "file": "session_service/list_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sessions", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client#list_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse", - "client": { - "short_name": "SessionService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SessionService::Client" - }, - "method": { - "short_name": "ListSessions", - "full_name": "google.cloud.discoveryengine.v1.SessionService.ListSessions", - "service": { - "short_name": "SessionService", - "full_name": "google.cloud.discoveryengine.v1.SessionService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_GetSiteSearchEngine_sync", - "title": "Snippet for the get_site_search_engine call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine.", - "file": "site_search_engine_service/get_site_search_engine.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_site_search_engine", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_site_search_engine", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "GetSiteSearchEngine", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.GetSiteSearchEngine", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_CreateTargetSite_sync", - "title": "Snippet for the create_target_site call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site.", - "file": "site_search_engine_service/create_target_site.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_target_site", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_target_site", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "CreateTargetSite", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.CreateTargetSite", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_BatchCreateTargetSites_sync", - "title": "Snippet for the batch_create_target_sites call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites.", - "file": "site_search_engine_service/batch_create_target_sites.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_target_sites", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_create_target_sites", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "BatchCreateTargetSites", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.BatchCreateTargetSites", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_GetTargetSite_sync", - "title": "Snippet for the get_target_site call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site.", - "file": "site_search_engine_service/get_target_site.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_target_site", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#get_target_site", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::TargetSite", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "GetTargetSite", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.GetTargetSite", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_UpdateTargetSite_sync", - "title": "Snippet for the update_target_site call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site.", - "file": "site_search_engine_service/update_target_site.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_target_site", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#update_target_site", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "UpdateTargetSite", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.UpdateTargetSite", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DeleteTargetSite_sync", - "title": "Snippet for the delete_target_site call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site.", - "file": "site_search_engine_service/delete_target_site.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_target_site", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_target_site", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "DeleteTargetSite", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DeleteTargetSite", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_ListTargetSites_sync", - "title": "Snippet for the list_target_sites call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites.", - "file": "site_search_engine_service/list_target_sites.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_target_sites", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#list_target_sites", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "ListTargetSites", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.ListTargetSites", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_CreateSitemap_sync", - "title": "Snippet for the create_sitemap call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap.", - "file": "site_search_engine_service/create_sitemap.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_sitemap", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#create_sitemap", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "CreateSitemap", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.CreateSitemap", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DeleteSitemap_sync", - "title": "Snippet for the delete_sitemap call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap.", - "file": "site_search_engine_service/delete_sitemap.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_sitemap", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#delete_sitemap", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "DeleteSitemap", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DeleteSitemap", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_FetchSitemaps_sync", - "title": "Snippet for the fetch_sitemaps call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps.", - "file": "site_search_engine_service/fetch_sitemaps.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_sitemaps", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_sitemaps", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "FetchSitemaps", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.FetchSitemaps", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_EnableAdvancedSiteSearch_sync", - "title": "Snippet for the enable_advanced_site_search call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search.", - "file": "site_search_engine_service/enable_advanced_site_search.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_advanced_site_search", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#enable_advanced_site_search", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "EnableAdvancedSiteSearch", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.EnableAdvancedSiteSearch", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_DisableAdvancedSiteSearch_sync", - "title": "Snippet for the disable_advanced_site_search call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search.", - "file": "site_search_engine_service/disable_advanced_site_search.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_advanced_site_search", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#disable_advanced_site_search", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "DisableAdvancedSiteSearch", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.DisableAdvancedSiteSearch", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_RecrawlUris_sync", - "title": "Snippet for the recrawl_uris call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris.", - "file": "site_search_engine_service/recrawl_uris.rb", - "language": "RUBY", - "client_method": { - "short_name": "recrawl_uris", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#recrawl_uris", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "RecrawlUris", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.RecrawlUris", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_BatchVerifyTargetSites_sync", - "title": "Snippet for the batch_verify_target_sites call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites.", - "file": "site_search_engine_service/batch_verify_target_sites.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_verify_target_sites", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#batch_verify_target_sites", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "BatchVerifyTargetSites", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.BatchVerifyTargetSites", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_SiteSearchEngineService_FetchDomainVerificationStatus_sync", - "title": "Snippet for the fetch_domain_verification_status call in the SiteSearchEngineService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status.", - "file": "site_search_engine_service/fetch_domain_verification_status.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_domain_verification_status", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client#fetch_domain_verification_status", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse", - "client": { - "short_name": "SiteSearchEngineService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client" - }, - "method": { - "short_name": "FetchDomainVerificationStatus", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService.FetchDomainVerificationStatus", - "service": { - "short_name": "SiteSearchEngineService", - "full_name": "google.cloud.discoveryengine.v1.SiteSearchEngineService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync", - "title": "Snippet for the write_user_event call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event.", - "file": "user_event_service/write_user_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "write_user_event", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::UserEvent", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" - }, - "method": { - "short_name": "WriteUserEvent", - "full_name": "google.cloud.discoveryengine.v1.UserEventService.WriteUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.discoveryengine.v1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync", - "title": "Snippet for the collect_user_event call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event.", - "file": "user_event_service/collect_user_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "collect_user_event", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Api::HttpBody", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" - }, - "method": { - "short_name": "CollectUserEvent", - "full_name": "google.cloud.discoveryengine.v1.UserEventService.CollectUserEvent", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.discoveryengine.v1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync", - "title": "Snippet for the purge_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events.", - "file": "user_event_service/purge_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_user_events", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" - }, - "method": { - "short_name": "PurgeUserEvents", - "full_name": "google.cloud.discoveryengine.v1.UserEventService.PurgeUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.discoveryengine.v1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync", - "title": "Snippet for the import_user_events call in the UserEventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events.", - "file": "user_event_service/import_user_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_user_events", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserEventService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client" - }, - "method": { - "short_name": "ImportUserEvents", - "full_name": "google.cloud.discoveryengine.v1.UserEventService.ImportUserEvents", - "service": { - "short_name": "UserEventService", - "full_name": "google.cloud.discoveryengine.v1.UserEventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync", - "title": "Snippet for the list_user_licenses call in the UserLicenseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses.", - "file": "user_license_service/list_user_licenses.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_user_licenses", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse", - "client": { - "short_name": "UserLicenseService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client" - }, - "method": { - "short_name": "ListUserLicenses", - "full_name": "google.cloud.discoveryengine.v1.UserLicenseService.ListUserLicenses", - "service": { - "short_name": "UserLicenseService", - "full_name": "google.cloud.discoveryengine.v1.UserLicenseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync", - "title": "Snippet for the batch_update_user_licenses call in the UserLicenseService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses.", - "file": "user_license_service/batch_update_user_licenses.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_user_licenses", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "UserLicenseService::Client", - "full_name": "::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client" - }, - "method": { - "short_name": "BatchUpdateUserLicenses", - "full_name": "google.cloud.discoveryengine.v1.UserLicenseService.BatchUpdateUserLicenses", - "service": { - "short_name": "UserLicenseService", - "full_name": "google.cloud.discoveryengine.v1.UserLicenseService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb deleted file mode 100644 index d389c637b58d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/collect_user_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the collect_user_event call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#collect_user_event. -# -def collect_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new - - # Call the collect_user_event method. - result = client.collect_user_event request - - # The returned object is of type Google::Api::HttpBody. - p result -end -# [END discoveryengine_v1_generated_UserEventService_CollectUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb deleted file mode 100644 index b36bd414b229..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/import_user_events.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the import_user_events call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#import_user_events. -# -def import_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new - - # Call the import_user_events method. - result = client.import_user_events request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_UserEventService_ImportUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb deleted file mode 100644 index 25da932780cb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/purge_user_events.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the purge_user_events call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#purge_user_events. -# -def purge_user_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new - - # Call the purge_user_events method. - result = client.purge_user_events request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb deleted file mode 100644 index bfef48ec7efc..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_event_service/write_user_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the write_user_event call in the UserEventService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserEventService::Client#write_user_event. -# -def write_user_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new - - # Call the write_user_event method. - result = client.write_user_event request - - # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. - p result -end -# [END discoveryengine_v1_generated_UserEventService_WriteUserEvent_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb deleted file mode 100644 index 71ab81e2aea0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/batch_update_user_licenses.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the batch_update_user_licenses call in the UserLicenseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#batch_update_user_licenses. -# -def batch_update_user_licenses - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new - - # Call the batch_update_user_licenses method. - result = client.batch_update_user_licenses request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END discoveryengine_v1_generated_UserLicenseService_BatchUpdateUserLicenses_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb deleted file mode 100644 index f2f1bd9358bd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/snippets/user_license_service/list_user_licenses.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync] -require "google/cloud/discovery_engine/v1" - -## -# Snippet for the list_user_licenses call in the UserLicenseService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client#list_user_licenses. -# -def list_user_licenses - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new - - # Call the list_user_licenses method. - result = client.list_user_licenses request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense. - p item - end -end -# [END discoveryengine_v1_generated_UserLicenseService_ListUserLicenses_sync] diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb deleted file mode 100644 index 68a5da979595..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_paths_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/assistant_service" - -class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_assistant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assistant_path project: "value0", location: "value1", collection: "value2", engine: "value3", assistant: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/assistants/value4", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb deleted file mode 100644 index f90cc7c364f8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_rest_test.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/assistant_service_pb" -require "google/cloud/discovery_engine/v1/assistant_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_stream_assist - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - query = {} - session = "hello world" - user_metadata = {} - tools_spec = {} - generation_spec = {} - - stream_assist_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::ServiceStub.stub :transcode_stream_assist_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stream_assist_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.stream_assist name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.stream_assist ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.stream_assist(::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, stream_assist_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb deleted file mode 100644 index 86795293888e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/assistant_service_test.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/assistant_service_pb" -require "google/cloud/discovery_engine/v1/assistant_service" - -class ::Google::Cloud::DiscoveryEngine::V1::AssistantService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_stream_assist - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - name = "hello world" - query = {} - session = "hello world" - user_metadata = {} - tools_spec = {} - generation_spec = {} - - stream_assist_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :stream_assist, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AssistUserMetadata), request["user_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::ToolsSpec), request["tools_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest::GenerationSpec), request["generation_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stream_assist_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stream_assist name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stream_assist ::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stream_assist({ name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stream_assist(::Google::Cloud::DiscoveryEngine::V1::StreamAssistRequest.new(name: name, query: query, session: session, user_metadata: user_metadata, tools_spec: tools_spec, generation_spec: generation_spec), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::StreamAssistResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, stream_assist_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AssistantService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb deleted file mode 100644 index 1ccd248038e8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" -require "google/cloud/discoveryengine/v1/cmek_config_service_services_pb" -require "google/cloud/discovery_engine/v1/cmek_config_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb deleted file mode 100644 index 0d066a121995..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_paths_test.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/cmek_config_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_cmek_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cmek_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/cmekConfig", path - - path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" - assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path - end - end - - def test_crypto_key_versions_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_crypto_keys_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb deleted file mode 100644 index 5e51e0881317..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_rest_test.rb +++ /dev/null @@ -1,316 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" -require "google/cloud/discovery_engine/v1/cmek_config_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_cmek_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - config = {} - set_default = true - - update_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_update_cmek_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cmek_config({ config: config, set_default: set_default }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cmek_config config: config, set_default: set_default do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cmek_config ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cmek_config({ config: config, set_default: set_default }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cmek_config(::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cmek_config_client_stub.call_count - end - end - end - - def test_get_cmek_config - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_get_cmek_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cmek_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cmek_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cmek_config ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cmek_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cmek_config(::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cmek_config_client_stub.call_count - end - end - end - - def test_list_cmek_configs - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_cmek_configs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_list_cmek_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_cmek_configs_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_cmek_configs({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_cmek_configs parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_cmek_configs ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_cmek_configs({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_cmek_configs(::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_cmek_configs_client_stub.call_count - end - end - end - - def test_delete_cmek_config - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_cmek_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::ServiceStub.stub :transcode_delete_cmek_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cmek_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cmek_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cmek_config ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cmek_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cmek_config(::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cmek_config_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb deleted file mode 100644 index 31bbc58df373..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/cmek_config_service_test.rb +++ /dev/null @@ -1,362 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/cmek_config_service_pb" -require "google/cloud/discovery_engine/v1/cmek_config_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_cmek_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - config = {} - set_default = true - - update_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cmek_config, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::CmekConfig), request["config"] - assert_equal true, request["set_default"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cmek_config({ config: config, set_default: set_default }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cmek_config config: config, set_default: set_default do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cmek_config ::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cmek_config({ config: config, set_default: set_default }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cmek_config(::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new(config: config, set_default: set_default), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cmek_config_client_stub.call_rpc_count - end - end - - def test_get_cmek_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CmekConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cmek_config, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cmek_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cmek_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cmek_config ::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cmek_config({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cmek_config(::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cmek_config_client_stub.call_rpc_count - end - end - - def test_list_cmek_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_cmek_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_cmek_configs, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_cmek_configs_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_cmek_configs({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_cmek_configs parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_cmek_configs ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_cmek_configs({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_cmek_configs(::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_cmek_configs_client_stub.call_rpc_count - end - end - - def test_delete_cmek_config - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_cmek_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cmek_config, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cmek_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cmek_config({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cmek_config name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cmek_config ::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cmek_config({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cmek_config(::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cmek_config_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb deleted file mode 100644 index f27e79b51f36..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/completion_service_pb" -require "google/cloud/discoveryengine/v1/completion_service_services_pb" -require "google/cloud/discovery_engine/v1/completion_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb deleted file mode 100644 index b37649623cc9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_paths_test.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/completion_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb deleted file mode 100644 index a53895abee84..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_rest_test.rb +++ /dev/null @@ -1,376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/completion_service_pb" -require "google/cloud/discovery_engine/v1/completion_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - data_store = "hello world" - query = "hello world" - query_model = "hello world" - user_pseudo_id = "hello world" - include_tail_suggestions = true - - complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.complete_query data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.complete_query ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_count - end - end - end - - def test_import_suggestion_deny_list_entries - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - - import_suggestion_deny_list_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_import_suggestion_deny_list_entries_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_suggestion_deny_list_entries_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_suggestion_deny_list_entries inline_source: inline_source, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_suggestion_deny_list_entries_client_stub.call_count - end - end - end - - def test_purge_suggestion_deny_list_entries - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - purge_suggestion_deny_list_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_purge_suggestion_deny_list_entries_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_suggestion_deny_list_entries_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_suggestion_deny_list_entries({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_suggestion_deny_list_entries parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_suggestion_deny_list_entries({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_suggestion_deny_list_entries_client_stub.call_count - end - end - end - - def test_import_completion_suggestions - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - - import_completion_suggestions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_import_completion_suggestions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_completion_suggestions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_completion_suggestions inline_source: inline_source, parent: parent, error_config: error_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_completion_suggestions_client_stub.call_count - end - end - end - - def test_purge_completion_suggestions - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - purge_completion_suggestions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::ServiceStub.stub :transcode_purge_completion_suggestions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_completion_suggestions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_completion_suggestions({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_completion_suggestions parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_completion_suggestions({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_completion_suggestions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb deleted file mode 100644 index bdd0cb013cde..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/completion_service_test.rb +++ /dev/null @@ -1,444 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/completion_service_pb" -require "google/cloud/discovery_engine/v1/completion_service" - -class ::Google::Cloud::DiscoveryEngine::V1::CompletionService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - data_store = "hello world" - query = "hello world" - query_model = "hello world" - user_pseudo_id = "hello world" - include_tail_suggestions = true - - complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_query, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest, request - assert_equal "hello world", request["data_store"] - assert_equal "hello world", request["query"] - assert_equal "hello world", request["query_model"] - assert_equal "hello world", request["user_pseudo_id"] - assert_equal true, request["include_tail_suggestions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.complete_query data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.complete_query ::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.complete_query({ data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new(data_store: data_store, query: query, query_model: query_model, user_pseudo_id: user_pseudo_id, include_tail_suggestions: include_tail_suggestions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, complete_query_client_stub.call_rpc_count - end - end - - def test_import_suggestion_deny_list_entries - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - - import_suggestion_deny_list_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_suggestion_deny_list_entries, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_suggestion_deny_list_entries_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_suggestion_deny_list_entries inline_source: inline_source, parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_suggestion_deny_list_entries({ inline_source: inline_source, parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::ImportSuggestionDenyListEntriesRequest.new(inline_source: inline_source, parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_suggestion_deny_list_entries_client_stub.call_rpc_count - end - end - - def test_purge_suggestion_deny_list_entries - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - purge_suggestion_deny_list_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_suggestion_deny_list_entries, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_suggestion_deny_list_entries_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_suggestion_deny_list_entries({ parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_suggestion_deny_list_entries parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_suggestion_deny_list_entries ::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_suggestion_deny_list_entries({ parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_suggestion_deny_list_entries(::Google::Cloud::DiscoveryEngine::V1::PurgeSuggestionDenyListEntriesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, purge_suggestion_deny_list_entries_client_stub.call_rpc_count - end - end - - def test_import_completion_suggestions - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - - import_completion_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_completion_suggestions, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_completion_suggestions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_completion_suggestions inline_source: inline_source, parent: parent, error_config: error_config do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_completion_suggestions({ inline_source: inline_source, parent: parent, error_config: error_config }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::ImportCompletionSuggestionsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_completion_suggestions_client_stub.call_rpc_count - end - end - - def test_purge_completion_suggestions - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - purge_completion_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_completion_suggestions, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_completion_suggestions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_completion_suggestions({ parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_completion_suggestions parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_completion_suggestions ::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_completion_suggestions({ parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_completion_suggestions(::Google::Cloud::DiscoveryEngine::V1::PurgeCompletionSuggestionsRequest.new(parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, purge_completion_suggestions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CompletionService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb deleted file mode 100644 index 778825d28d06..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/control_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ControlService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_control_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.control_path project: "value0", location: "value1", data_store: "value2", control: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/controls/value3", path - - path = client.control_path project: "value0", location: "value1", collection: "value2", data_store: "value3", control: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/controls/value4", path - - path = client.control_path project: "value0", location: "value1", collection: "value2", engine: "value3", control: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/controls/value4", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_engine_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb deleted file mode 100644 index 6eb9f920087c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_rest_test.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/control_service_pb" -require "google/cloud/discovery_engine/v1/control_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_control - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - control = {} - control_id = "hello world" - - create_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_create_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_control({ parent: parent, control: control, control_id: control_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_control parent: parent, control: control, control_id: control_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_control ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_control({ parent: parent, control: control, control_id: control_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_control(::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_control_client_stub.call_count - end - end - end - - def test_delete_control - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_delete_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_control({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_control name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_control ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_control({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_control(::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_control_client_stub.call_count - end - end - end - - def test_update_control - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - control = {} - update_mask = {} - - update_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_update_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_control({ control: control, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_control control: control, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_control ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_control({ control: control, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_control(::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_control_client_stub.call_count - end - end - end - - def test_get_control - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Control.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_control_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_get_control_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_control({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_control name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_control ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_control({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_control(::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_control_client_stub.call_count - end - end - end - - def test_list_controls - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_controls_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::ServiceStub.stub :transcode_list_controls_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_controls_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_controls parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_controls ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_controls(::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_controls_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb deleted file mode 100644 index 5a0fdd64487c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/control_service_test.rb +++ /dev/null @@ -1,411 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/control_service_pb" -require "google/cloud/discovery_engine/v1/control_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ControlService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - control = {} - control_id = "hello world" - - create_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_control, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Control), request["control"] - assert_equal "hello world", request["control_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_control({ parent: parent, control: control, control_id: control_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_control parent: parent, control: control, control_id: control_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_control ::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_control({ parent: parent, control: control, control_id: control_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_control(::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new(parent: parent, control: control, control_id: control_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_control_client_stub.call_rpc_count - end - end - - def test_delete_control - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_control, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_control({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_control name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_control ::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_control({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_control(::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_control_client_stub.call_rpc_count - end - end - - def test_update_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - control = {} - update_mask = {} - - update_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_control, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Control), request["control"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_control({ control: control, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_control control: control, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_control ::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_control({ control: control, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_control(::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new(control: control, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_control_client_stub.call_rpc_count - end - end - - def test_get_control - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Control.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_control_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_control, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_control_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_control({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_control name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_control ::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_control({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_control(::Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_control_client_stub.call_rpc_count - end - end - - def test_list_controls - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListControlsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_controls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_controls, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_controls_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_controls parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_controls ::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_controls({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_controls(::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_controls_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb deleted file mode 100644 index c7e15d3b262e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_paths_test.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/conversational_search_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_answer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.answer_path project: "value0", location: "value1", data_store: "value2", session: "value3", answer: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3/answers/value4", path - - path = client.answer_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4", answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4/answers/value5", path - - path = client.answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/answers/value5", path - end - end - - def test_assist_answer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assist_answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", assist_answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/assistAnswers/value5", path - end - end - - def test_chunk_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.chunk_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4", chunk: "value5" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4/chunks/value5", path - - path = client.chunk_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5", chunk: "value6" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5/chunks/value6", path - end - end - - def test_conversation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_path project: "value0", location: "value1", data_store: "value2", conversation: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/conversations/value3", path - - path = client.conversation_path project: "value0", location: "value1", collection: "value2", data_store: "value3", conversation: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/conversations/value4", path - - path = client.conversation_path project: "value0", location: "value1", collection: "value2", engine: "value3", conversation: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/conversations/value4", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb deleted file mode 100644 index de1b4d8b81ed..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_rest_test.rb +++ /dev/null @@ -1,900 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/conversational_search_service_pb" -require "google/cloud/discovery_engine/v1/conversational_search_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_converse_conversation - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - query = {} - serving_config = "hello world" - conversation = {} - safe_search = true - user_labels = {} - summary_spec = {} - filter = "hello world" - boost_spec = {} - - converse_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_converse_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, converse_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.converse_conversation name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.converse_conversation ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.converse_conversation(::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, converse_conversation_client_stub.call_count - end - end - end - - def test_create_conversation - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - conversation = {} - - create_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_create_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_conversation({ parent: parent, conversation: conversation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_conversation parent: parent, conversation: conversation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_conversation ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_conversation({ parent: parent, conversation: conversation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_conversation(::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_conversation_client_stub.call_count - end - end - end - - def test_delete_conversation - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_delete_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_conversation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_conversation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_conversation ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_conversation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_conversation(::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_conversation_client_stub.call_count - end - end - end - - def test_update_conversation - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - conversation = {} - update_mask = {} - - update_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_update_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_conversation({ conversation: conversation, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_conversation conversation: conversation, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_conversation ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_conversation({ conversation: conversation, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_conversation(::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_conversation_client_stub.call_count - end - end - end - - def test_get_conversation - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_conversation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_conversation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_conversation ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_conversation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_conversation(::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_conversation_client_stub.call_count - end - end - end - - def test_list_conversations - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_conversations_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_list_conversations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_conversations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_conversations ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_conversations(::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_conversations_client_stub.call_count - end - end - end - - def test_answer_query - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - query = {} - session = "hello world" - safety_spec = {} - related_questions_spec = {} - grounding_spec = {} - answer_generation_spec = {} - search_spec = {} - query_understanding_spec = {} - asynchronous_mode = true - user_pseudo_id = "hello world" - user_labels = {} - end_user_spec = {} - - answer_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_answer_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, answer_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, answer_query_client_stub.call_count - end - end - end - - def test_stream_answer_query - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - query = {} - session = "hello world" - safety_spec = {} - related_questions_spec = {} - grounding_spec = {} - answer_generation_spec = {} - search_spec = {} - query_understanding_spec = {} - asynchronous_mode = true - user_pseudo_id = "hello world" - user_labels = {} - end_user_spec = {} - - stream_answer_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, is_server_streaming:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_stream_answer_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stream_answer_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use named arguments - client.stream_answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object - client.stream_answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use hash object with options - client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Use protobuf object with options - client.stream_answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end.first - - # Verify method calls - assert_equal 5, stream_answer_query_client_stub.call_count - end - end - end - - def test_get_answer - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Answer.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_answer_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_answer_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_answer_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_answer({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_answer name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_answer ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_answer({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_answer(::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_answer_client_stub.call_count - end - end - end - - def test_create_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - - create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_session({ parent: parent, session: session }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_session parent: parent, session: session do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_session({ parent: parent, session: session }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_count - end - end - end - - def test_delete_session - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_session({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_session name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_session({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_count - end - end - end - - def test_update_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session = {} - update_mask = {} - - update_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_update_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_session({ session: session, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_session session: session, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_session({ session: session, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_session_client_stub.call_count - end - end - end - - def test_get_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - include_answer_details = true - - get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_session({ name: name, include_answer_details: include_answer_details }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_session name: name, include_answer_details: include_answer_details do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_session({ name: name, include_answer_details: include_answer_details }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_count - end - end - end - - def test_list_sessions - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb deleted file mode 100644 index b108183f701b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/conversational_search_service_test.rb +++ /dev/null @@ -1,1031 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/conversational_search_service_pb" -require "google/cloud/discovery_engine/v1/conversational_search_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_converse_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - query = {} - serving_config = "hello world" - conversation = {} - safe_search = true - user_labels = {} - summary_spec = {} - filter = "hello world" - boost_spec = {} - - converse_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :converse_conversation, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TextInput), request["query"] - assert_equal "hello world", request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] - assert_equal true, request["safe_search"] - assert_equal({}, request["user_labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SummarySpec), request["summary_spec"] - assert_equal "hello world", request["filter"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, converse_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.converse_conversation name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.converse_conversation ::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.converse_conversation({ name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.converse_conversation(::Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new(name: name, query: query, serving_config: serving_config, conversation: conversation, safe_search: safe_search, user_labels: user_labels, summary_spec: summary_spec, filter: filter, boost_spec: boost_spec), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, converse_conversation_client_stub.call_rpc_count - end - end - - def test_create_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - conversation = {} - - create_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_conversation({ parent: parent, conversation: conversation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_conversation parent: parent, conversation: conversation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_conversation ::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_conversation({ parent: parent, conversation: conversation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_conversation(::Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new(parent: parent, conversation: conversation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_conversation_client_stub.call_rpc_count - end - end - - def test_delete_conversation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_conversation, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_conversation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_conversation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_conversation ::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_conversation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_conversation(::Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_conversation_client_stub.call_rpc_count - end - end - - def test_update_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - conversation = {} - update_mask = {} - - update_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_conversation, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Conversation), request["conversation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_conversation({ conversation: conversation, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_conversation conversation: conversation, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_conversation ::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_conversation({ conversation: conversation, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_conversation(::Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new(conversation: conversation, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_conversation_client_stub.call_rpc_count - end - end - - def test_get_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Conversation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_conversation, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_conversation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_conversation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_conversation ::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_conversation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_conversation(::Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_conversation_client_stub.call_rpc_count - end - end - - def test_list_conversations - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListConversationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_conversations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversations, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_conversations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_conversations parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_conversations ::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_conversations({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_conversations(::Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_conversations_client_stub.call_rpc_count - end - end - - def test_answer_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - query = {} - session = "hello world" - safety_spec = {} - related_questions_spec = {} - grounding_spec = {} - answer_generation_spec = {} - search_spec = {} - query_understanding_spec = {} - asynchronous_mode = true - user_pseudo_id = "hello world" - user_labels = {} - end_user_spec = {} - - answer_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :answer_query, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec), request["safety_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec), request["related_questions_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec), request["grounding_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec), request["answer_generation_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec), request["search_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec), request["query_understanding_spec"] - assert_equal true, request["asynchronous_mode"] - assert_equal "hello world", request["user_pseudo_id"] - assert_equal({}, request["user_labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec), request["end_user_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, answer_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, answer_query_client_stub.call_rpc_count - end - end - - def test_stream_answer_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a server streaming method. - serving_config = "hello world" - query = {} - session = "hello world" - safety_spec = {} - related_questions_spec = {} - grounding_spec = {} - answer_generation_spec = {} - search_spec = {} - query_understanding_spec = {} - asynchronous_mode = true - user_pseudo_id = "hello world" - user_labels = {} - end_user_spec = {} - - stream_answer_query_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :stream_answer_query, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Query), request["query"] - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec), request["safety_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec), request["related_questions_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::GroundingSpec), request["grounding_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec), request["answer_generation_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec), request["search_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec), request["query_understanding_spec"] - assert_equal true, request["asynchronous_mode"] - assert_equal "hello world", request["user_pseudo_id"] - assert_equal({}, request["user_labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::EndUserSpec), request["end_user_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stream_answer_query_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stream_answer_query serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stream_answer_query ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stream_answer_query({ serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec }, grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stream_answer_query(::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new(serving_config: serving_config, query: query, session: session, safety_spec: safety_spec, related_questions_spec: related_questions_spec, grounding_spec: grounding_spec, answer_generation_spec: answer_generation_spec, search_spec: search_spec, query_understanding_spec: query_understanding_spec, asynchronous_mode: asynchronous_mode, user_pseudo_id: user_pseudo_id, user_labels: user_labels, end_user_spec: end_user_spec), grpc_options) do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse, r - end - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, stream_answer_query_client_stub.call_rpc_count - end - end - - def test_get_answer - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Answer.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_answer_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_answer, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_answer_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_answer({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_answer name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_answer ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_answer({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_answer(::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_answer_client_stub.call_rpc_count - end - end - - def test_create_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - - create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session({ parent: parent, session: session }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session parent: parent, session: session do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session({ parent: parent, session: session }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_rpc_count - end - end - - def test_delete_session - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_rpc_count - end - end - - def test_update_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = {} - update_mask = {} - - update_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_session({ session: session, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_session session: session, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_session({ session: session, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_session_client_stub.call_rpc_count - end - end - - def test_get_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - include_answer_details = true - - get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["include_answer_details"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session({ name: name, include_answer_details: include_answer_details }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session name: name, include_answer_details: include_answer_details do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session({ name: name, include_answer_details: include_answer_details }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_rpc_count - end - end - - def test_list_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sessions, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb deleted file mode 100644 index cf6034bc47f7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/data_store_service_pb" -require "google/cloud/discoveryengine/v1/data_store_service_services_pb" -require "google/cloud/discovery_engine/v1/data_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb deleted file mode 100644 index 0f78cdf60586..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_paths_test.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/data_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_cmek_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cmek_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/cmekConfig", path - - path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" - assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path - end - end - - def test_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.collection_path project: "value0", location: "value1", collection: "value2" - assert_equal "projects/value0/locations/value1/collections/value2", path - end - end - - def test_crypto_key_versions_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_crypto_keys_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_processing_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_processing_config_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2/documentProcessingConfig", path - - path = client.document_processing_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/documentProcessingConfig", path - end - end - - def test_identity_mapping_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.identity_mapping_store_path project: "value0", location: "value1", identity_mapping_store: "value2" - assert_equal "projects/value0/locations/value1/identityMappingStores/value2", path - end - end - - def test_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.schema_path project: "value0", location: "value1", data_store: "value2", schema: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/schemas/value3", path - - path = client.schema_path project: "value0", location: "value1", collection: "value2", data_store: "value3", schema: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/schemas/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb deleted file mode 100644 index 873fb9a4a439..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_rest_test.rb +++ /dev/null @@ -1,378 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/data_store_service_pb" -require "google/cloud/discovery_engine/v1/data_store_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_data_store - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - cmek_config_name = "hello world" - parent = "hello world" - data_store = {} - data_store_id = "hello world" - create_advanced_site_search = true - skip_default_schema_creation = true - - create_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_create_data_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_data_store cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_data_store ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_data_store(::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_data_store_client_stub.call_count - end - end - end - - def test_get_data_store - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_get_data_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_data_store({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_data_store name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_data_store ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_data_store({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_data_store(::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_data_store_client_stub.call_count - end - end - end - - def test_list_data_stores - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_data_stores_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_list_data_stores_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_data_stores_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_data_stores parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_data_stores ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_data_stores(::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_data_stores_client_stub.call_count - end - end - end - - def test_delete_data_store - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_delete_data_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_data_store({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_data_store name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_data_store ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_data_store({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_data_store(::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_data_store_client_stub.call_count - end - end - end - - def test_update_data_store - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - data_store = {} - update_mask = {} - - update_data_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::ServiceStub.stub :transcode_update_data_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_data_store({ data_store: data_store, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_data_store data_store: data_store, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_data_store ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_data_store({ data_store: data_store, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_data_store(::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_data_store_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb deleted file mode 100644 index 280024bc29a9..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/data_store_service_test.rb +++ /dev/null @@ -1,442 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/data_store_service_pb" -require "google/cloud/discovery_engine/v1/data_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_data_store - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - cmek_config_name = "hello world" - parent = "hello world" - data_store = {} - data_store_id = "hello world" - create_advanced_site_search = true - skip_default_schema_creation = true - - create_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_data_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest, request - assert_equal "hello world", request["cmek_config_name"] - assert_equal :cmek_config_name, request.cmek_options - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::DataStore), request["data_store"] - assert_equal "hello world", request["data_store_id"] - assert_equal true, request["create_advanced_site_search"] - assert_equal true, request["skip_default_schema_creation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_data_store cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_data_store ::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_data_store({ cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_data_store(::Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, data_store: data_store, data_store_id: data_store_id, create_advanced_site_search: create_advanced_site_search, skip_default_schema_creation: skip_default_schema_creation), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_data_store_client_stub.call_rpc_count - end - end - - def test_get_data_store - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_data_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_data_store({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_data_store name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_data_store ::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_data_store({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_data_store(::Google::Cloud::DiscoveryEngine::V1::GetDataStoreRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_data_store_client_stub.call_rpc_count - end - end - - def test_list_data_stores - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_data_stores_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_data_stores, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_data_stores_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_data_stores parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_data_stores ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_data_stores({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_data_stores(::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_data_stores_client_stub.call_rpc_count - end - end - - def test_delete_data_store - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_data_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_data_store({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_data_store name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_data_store ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_data_store({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_data_store(::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_data_store_client_stub.call_rpc_count - end - end - - def test_update_data_store - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::DataStore.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - data_store = {} - update_mask = {} - - update_data_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_data_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::DataStore), request["data_store"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_data_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_data_store({ data_store: data_store, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_data_store data_store: data_store, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_data_store ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_data_store({ data_store: data_store, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_data_store(::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new(data_store: data_store, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_data_store_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb deleted file mode 100644 index a73e23fc74cb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/document_service_pb" -require "google/cloud/discoveryengine/v1/document_service_services_pb" -require "google/cloud/discovery_engine/v1/document_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb deleted file mode 100644 index c41403c25931..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_paths_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/document_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", data_store: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3", path - - path = client.branch_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_fhir_resource_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.fhir_resource_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3", resource_type: "value4", fhir_resource_id: "value5" - assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3/fhir/value4/value5", path - end - end - - def test_fhir_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.fhir_store_path project: "value0", location: "value1", dataset: "value2", fhir_store: "value3" - assert_equal "projects/value0/locations/value1/datasets/value2/fhirStores/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb deleted file mode 100644 index 540b53eef8e7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_rest_test.rb +++ /dev/null @@ -1,549 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/document_service_pb" -require "google/cloud/discovery_engine/v1/document_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_document - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_document({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_document name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_document ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_document({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_count - end - end - end - - def test_list_documents - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_documents parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_documents ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_documents(::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_documents_client_stub.call_count - end - end - end - - def test_create_document - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - document = {} - document_id = "hello world" - - create_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_document({ parent: parent, document: document, document_id: document_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_document parent: parent, document: document, document_id: document_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_document ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_document({ parent: parent, document: document, document_id: document_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_document(::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_document_client_stub.call_count - end - end - end - - def test_update_document - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Document.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - document = {} - allow_missing = true - update_mask = {} - - update_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_document document: document, allow_missing: allow_missing, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_document ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_document(::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_document_client_stub.call_count - end - end - end - - def test_delete_document - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_document({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_document name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_document ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_document({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_document(::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_document_client_stub.call_count - end - end - end - - def test_import_documents - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED - update_mask = {} - auto_generate_ids = true - id_field = "hello world" - force_refresh_content = true - - import_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_documents inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_documents ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_documents(::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_documents_client_stub.call_count - end - end - end - - def test_purge_documents - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - gcs_source = {} - parent = "hello world" - filter = "hello world" - error_config = {} - force = true - - purge_documents_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_purge_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_documents gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_documents ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_documents(::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_documents_client_stub.call_count - end - end - end - - def test_batch_get_documents_metadata - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - matcher = {} - - batch_get_documents_metadata_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::ServiceStub.stub :transcode_batch_get_documents_metadata_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_get_documents_metadata_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_get_documents_metadata({ parent: parent, matcher: matcher }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_get_documents_metadata parent: parent, matcher: matcher do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_get_documents_metadata ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_get_documents_metadata({ parent: parent, matcher: matcher }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_get_documents_metadata(::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_get_documents_metadata_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb deleted file mode 100644 index 5e63fcbdc4db..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/document_service_test.rb +++ /dev/null @@ -1,635 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/document_service_pb" -require "google/cloud/discovery_engine/v1/document_service" - -class ::Google::Cloud::DiscoveryEngine::V1::DocumentService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_document, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_document({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_document name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_document ::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_document({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_document(::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_document_client_stub.call_rpc_count - end - end - - def test_list_documents - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_documents, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_documents parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_documents ::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_documents({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_documents(::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_documents_client_stub.call_rpc_count - end - end - - def test_create_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - document = {} - document_id = "hello world" - - create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_document, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Document), request["document"] - assert_equal "hello world", request["document_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_document({ parent: parent, document: document, document_id: document_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_document parent: parent, document: document, document_id: document_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_document ::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_document({ parent: parent, document: document, document_id: document_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_document(::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new(parent: parent, document: document, document_id: document_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_document_client_stub.call_rpc_count - end - end - - def test_update_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Document.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - document = {} - allow_missing = true - update_mask = {} - - update_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_document, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Document), request["document"] - assert_equal true, request["allow_missing"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_document document: document, allow_missing: allow_missing, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_document ::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_document({ document: document, allow_missing: allow_missing, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_document(::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new(document: document, allow_missing: allow_missing, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_document_client_stub.call_rpc_count - end - end - - def test_delete_document - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_document, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_document_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_document({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_document name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_document ::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_document({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_document(::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_document_client_stub.call_rpc_count - end - end - - def test_import_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - reconciliation_mode = :RECONCILIATION_MODE_UNSPECIFIED - update_mask = {} - auto_generate_ids = true - id_field = "hello world" - force_refresh_content = true - - import_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_documents, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] - assert_equal :RECONCILIATION_MODE_UNSPECIFIED, request["reconciliation_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["auto_generate_ids"] - assert_equal "hello world", request["id_field"] - assert_equal true, request["force_refresh_content"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_documents inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_documents ::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_documents({ inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_documents(::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config, reconciliation_mode: reconciliation_mode, update_mask: update_mask, auto_generate_ids: auto_generate_ids, id_field: id_field, force_refresh_content: force_refresh_content), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_documents_client_stub.call_rpc_count - end - end - - def test_purge_documents - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - gcs_source = {} - parent = "hello world" - filter = "hello world" - error_config = {} - force = true - - purge_documents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_documents, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GcsSource), request["gcs_source"] - assert_equal :gcs_source, request.source - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig), request["error_config"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_documents_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_documents gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_documents ::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_documents({ gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_documents(::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new(gcs_source: gcs_source, parent: parent, filter: filter, error_config: error_config, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, purge_documents_client_stub.call_rpc_count - end - end - - def test_batch_get_documents_metadata - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - matcher = {} - - batch_get_documents_metadata_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_get_documents_metadata, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher), request["matcher"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_get_documents_metadata_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_get_documents_metadata({ parent: parent, matcher: matcher }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_get_documents_metadata parent: parent, matcher: matcher do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_get_documents_metadata ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_get_documents_metadata({ parent: parent, matcher: matcher }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_get_documents_metadata(::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new(parent: parent, matcher: matcher), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_get_documents_metadata_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb deleted file mode 100644 index 3d1259a995e6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/engine_service_pb" -require "google/cloud/discoveryengine/v1/engine_service_services_pb" -require "google/cloud/discovery_engine/v1/engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::EngineService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb deleted file mode 100644 index d7191894692d..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::EngineService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.collection_path project: "value0", location: "value1", collection: "value2" - assert_equal "projects/value0/locations/value1/collections/value2", path - end - end - - def test_engine_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb deleted file mode 100644 index d4ec8b4977fb..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_rest_test.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/engine_service_pb" -require "google/cloud/discovery_engine/v1/engine_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_engine - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - engine = {} - engine_id = "hello world" - - create_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_create_engine_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_engine parent: parent, engine: engine, engine_id: engine_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_engine ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_engine(::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_engine_client_stub.call_count - end - end - end - - def test_delete_engine - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_delete_engine_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_engine({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_engine name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_engine ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_engine({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_engine(::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_engine_client_stub.call_count - end - end - end - - def test_update_engine - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Engine.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - engine = {} - update_mask = {} - - update_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_update_engine_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_engine({ engine: engine, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_engine engine: engine, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_engine ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_engine({ engine: engine, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_engine(::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_engine_client_stub.call_count - end - end - end - - def test_get_engine - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Engine.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_get_engine_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_engine({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_engine name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_engine ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_engine({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_engine(::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_engine_client_stub.call_count - end - end - end - - def test_list_engines - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_engines_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::ServiceStub.stub :transcode_list_engines_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_engines_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_engines parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_engines ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_engines(::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_engines_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb deleted file mode 100644 index 11c039f054ee..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/engine_service_test.rb +++ /dev/null @@ -1,435 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/engine_service_pb" -require "google/cloud/discovery_engine/v1/engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::EngineService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_engine - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - engine = {} - engine_id = "hello world" - - create_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_engine, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Engine), request["engine"] - assert_equal "hello world", request["engine_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_engine parent: parent, engine: engine, engine_id: engine_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_engine ::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_engine({ parent: parent, engine: engine, engine_id: engine_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_engine(::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest.new(parent: parent, engine: engine, engine_id: engine_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_engine_client_stub.call_rpc_count - end - end - - def test_delete_engine - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_engine, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_engine({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_engine name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_engine ::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_engine({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_engine(::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_engine_client_stub.call_rpc_count - end - end - - def test_update_engine - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Engine.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - engine = {} - update_mask = {} - - update_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_engine, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Engine), request["engine"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_engine({ engine: engine, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_engine engine: engine, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_engine ::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_engine({ engine: engine, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_engine(::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest.new(engine: engine, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_engine_client_stub.call_rpc_count - end - end - - def test_get_engine - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Engine.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_engine, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_engine({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_engine name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_engine ::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_engine({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_engine(::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_engine_client_stub.call_rpc_count - end - end - - def test_list_engines - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListEnginesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_engines_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_engines, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_engines_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_engines parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_engines ::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_engines({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_engines(::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_engines_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::EngineService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EngineService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb deleted file mode 100644 index c90837d6c3c5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_paths_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/grounded_generation_service" - -class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_grounding_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.grounding_config_path project: "value0", location: "value1", grounding_config: "value2" - assert_equal "projects/value0/locations/value1/groundingConfigs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb deleted file mode 100644 index 240d3c729a65..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_rest_test.rb +++ /dev/null @@ -1,216 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" -require "google/cloud/discovery_engine/v1/grounded_generation_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_generate_grounded_content - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - location = "hello world" - system_instruction = {} - contents = [{}] - generation_spec = {} - grounding_spec = {} - user_labels = {} - - generate_grounded_content_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.stub :transcode_generate_grounded_content_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_grounded_content_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_grounded_content location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_grounded_content ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_grounded_content(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_grounded_content_client_stub.call_count - end - end - end - - def test_check_grounding - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - grounding_config = "hello world" - answer_candidate = "hello world" - facts = [{}] - grounding_spec = {} - user_labels = {} - - check_grounding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::ServiceStub.stub :transcode_check_grounding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, check_grounding_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.check_grounding grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.check_grounding ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.check_grounding(::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, check_grounding_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb deleted file mode 100644 index 64883857ea17..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/grounded_generation_service_test.rb +++ /dev/null @@ -1,336 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/grounded_generation_service_pb" -require "google/cloud/discovery_engine/v1/grounded_generation_service" - -class ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_stream_generate_grounded_content - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a bidi streaming method. - location = "hello world" - system_instruction = {} - contents = [{}] - generation_spec = {} - grounding_spec = {} - user_labels = {} - - stream_generate_grounded_content_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :stream_generate_grounded_content, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, stream_generate_grounded_content_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } - request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels - enum_input = [request_hash, request_proto].to_enum - client.stream_generate_grounded_content enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } - request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels - stream_input = Gapic::StreamInput.new - client.stream_generate_grounded_content stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } - request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels - enum_input = [request_hash, request_proto].to_enum - client.stream_generate_grounded_content enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels } - request_proto = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels - stream_input = Gapic::StreamInput.new - client.stream_generate_grounded_content stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, stream_generate_grounded_content_client_stub.call_rpc_count - stream_generate_grounded_content_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, r - assert_equal "hello world", r["location"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent), r["system_instruction"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, r["contents"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec), r["generation_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec), r["grounding_spec"] - assert_equal({}, r["user_labels"].to_h) - end - end - end - end - - def test_generate_grounded_content - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - location = "hello world" - system_instruction = {} - contents = [{}] - generation_spec = {} - grounding_spec = {} - user_labels = {} - - generate_grounded_content_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_grounded_content, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest, request - assert_equal "hello world", request["location"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent), request["system_instruction"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationContent, request["contents"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GenerationSpec), request["generation_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest::GroundingSpec), request["grounding_spec"] - assert_equal({}, request["user_labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_grounded_content_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_grounded_content location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_grounded_content ::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_grounded_content({ location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_grounded_content(::Google::Cloud::DiscoveryEngine::V1::GenerateGroundedContentRequest.new(location: location, system_instruction: system_instruction, contents: contents, generation_spec: generation_spec, grounding_spec: grounding_spec, user_labels: user_labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_grounded_content_client_stub.call_rpc_count - end - end - - def test_check_grounding - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - grounding_config = "hello world" - answer_candidate = "hello world" - facts = [{}] - grounding_spec = {} - user_labels = {} - - check_grounding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :check_grounding, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest, request - assert_equal "hello world", request["grounding_config"] - assert_equal "hello world", request["answer_candidate"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundingFact, request["facts"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingSpec), request["grounding_spec"] - assert_equal({}, request["user_labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, check_grounding_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.check_grounding grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.check_grounding ::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.check_grounding({ grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.check_grounding(::Google::Cloud::DiscoveryEngine::V1::CheckGroundingRequest.new(grounding_config: grounding_config, answer_candidate: answer_candidate, facts: facts, grounding_spec: grounding_spec, user_labels: user_labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, check_grounding_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GroundedGenerationService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb deleted file mode 100644 index 7ad6e0168f52..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb deleted file mode 100644 index edffe53b2961..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_paths_test.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/identity_mapping_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_cmek_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cmek_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/cmekConfig", path - - path = client.cmek_config_path project: "value0", location: "value1", cmek_config: "value2" - assert_equal "projects/value0/locations/value1/cmekConfigs/value2", path - end - end - - def test_crypto_key_versions_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_key_versions_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path - end - end - - def test_crypto_keys_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.crypto_keys_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" - assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path - end - end - - def test_identity_mapping_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.identity_mapping_store_path project: "value0", location: "value1", identity_mapping_store: "value2" - assert_equal "projects/value0/locations/value1/identityMappingStores/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb deleted file mode 100644 index 3d502606805c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_rest_test.rb +++ /dev/null @@ -1,488 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_identity_mapping_store - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - cmek_config_name = "hello world" - parent = "hello world" - identity_mapping_store_id = "hello world" - identity_mapping_store = {} - - create_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_create_identity_mapping_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_identity_mapping_store cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_identity_mapping_store_client_stub.call_count - end - end - end - - def test_get_identity_mapping_store - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_get_identity_mapping_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_identity_mapping_store({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_identity_mapping_store name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_identity_mapping_store({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_identity_mapping_store_client_stub.call_count - end - end - end - - def test_delete_identity_mapping_store - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_identity_mapping_store_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_delete_identity_mapping_store_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_identity_mapping_store({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_identity_mapping_store name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_identity_mapping_store({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_identity_mapping_store_client_stub.call_count - end - end - end - - def test_import_identity_mappings - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - identity_mapping_store = "hello world" - - import_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_import_identity_mappings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_identity_mappings_client_stub.call_count - end - end - end - - def test_purge_identity_mappings - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - identity_mapping_store = "hello world" - filter = "hello world" - force = true - - purge_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_purge_identity_mappings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_identity_mappings_client_stub.call_count - end - end - end - - def test_list_identity_mappings - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - identity_mapping_store = "hello world" - page_size = 42 - page_token = "hello world" - - list_identity_mappings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_list_identity_mappings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_identity_mappings identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_identity_mappings_client_stub.call_count - end - end - end - - def test_list_identity_mapping_stores - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_identity_mapping_stores_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::ServiceStub.stub :transcode_list_identity_mapping_stores_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_identity_mapping_stores_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_identity_mapping_stores parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_identity_mapping_stores ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_identity_mapping_stores(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_identity_mapping_stores_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb deleted file mode 100644 index bb726435c20b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/identity_mapping_store_service_test.rb +++ /dev/null @@ -1,575 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/identity_mapping_store_service_pb" -require "google/cloud/discovery_engine/v1/identity_mapping_store_service" - -class ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_identity_mapping_store - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - cmek_config_name = "hello world" - parent = "hello world" - identity_mapping_store_id = "hello world" - identity_mapping_store = {} - - create_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_identity_mapping_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest, request - assert_equal "hello world", request["cmek_config_name"] - assert_equal :cmek_config_name, request.cmek_options - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["identity_mapping_store_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore), request["identity_mapping_store"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_identity_mapping_store cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_identity_mapping_store({ cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::CreateIdentityMappingStoreRequest.new(cmek_config_name: cmek_config_name, parent: parent, identity_mapping_store_id: identity_mapping_store_id, identity_mapping_store: identity_mapping_store), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_identity_mapping_store_client_stub.call_rpc_count - end - end - - def test_get_identity_mapping_store - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStore.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_identity_mapping_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_identity_mapping_store({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_identity_mapping_store name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_identity_mapping_store({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::GetIdentityMappingStoreRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_identity_mapping_store_client_stub.call_rpc_count - end - end - - def test_delete_identity_mapping_store - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_identity_mapping_store_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_identity_mapping_store, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_identity_mapping_store_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_identity_mapping_store({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_identity_mapping_store name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_identity_mapping_store ::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_identity_mapping_store({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_identity_mapping_store(::Google::Cloud::DiscoveryEngine::V1::DeleteIdentityMappingStoreRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_identity_mapping_store_client_stub.call_rpc_count - end - end - - def test_import_identity_mappings - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - identity_mapping_store = "hello world" - - import_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_identity_mappings, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["identity_mapping_store"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ImportIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_identity_mappings_client_stub.call_rpc_count - end - end - - def test_purge_identity_mappings - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - identity_mapping_store = "hello world" - filter = "hello world" - force = true - - purge_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_identity_mappings, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["identity_mapping_store"] - assert_equal "hello world", request["filter"] - assert_equal true, request["force"] - assert request.has_force? - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_identity_mappings inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_identity_mappings({ inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::PurgeIdentityMappingsRequest.new(inline_source: inline_source, identity_mapping_store: identity_mapping_store, filter: filter, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, purge_identity_mappings_client_stub.call_rpc_count - end - end - - def test_list_identity_mappings - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - identity_mapping_store = "hello world" - page_size = 42 - page_token = "hello world" - - list_identity_mappings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_identity_mappings, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest, request - assert_equal "hello world", request["identity_mapping_store"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_identity_mappings_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_identity_mappings identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_identity_mappings ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_identity_mappings({ identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_identity_mappings(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingsRequest.new(identity_mapping_store: identity_mapping_store, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_identity_mappings_client_stub.call_rpc_count - end - end - - def test_list_identity_mapping_stores - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_identity_mapping_stores_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_identity_mapping_stores, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_identity_mapping_stores_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_identity_mapping_stores parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_identity_mapping_stores ::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_identity_mapping_stores({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_identity_mapping_stores(::Google::Cloud::DiscoveryEngine::V1::ListIdentityMappingStoresRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_identity_mapping_stores_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::IdentityMappingStoreService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb deleted file mode 100644 index df69bd75f2c4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/project_service_pb" -require "google/cloud/discoveryengine/v1/project_service_services_pb" -require "google/cloud/discovery_engine/v1/project_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb deleted file mode 100644 index 39fddcfd5006..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/project_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb deleted file mode 100644 index 2d8a39a6494a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_rest_test.rb +++ /dev/null @@ -1,155 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/project_service_pb" -require "google/cloud/discovery_engine/v1/project_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_provision_project - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - accept_data_use_terms = true - data_use_terms_version = "hello world" - - provision_project_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::ServiceStub.stub :transcode_provision_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, provision_project_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.provision_project name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.provision_project ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.provision_project(::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, provision_project_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb deleted file mode 100644 index 5f272179858c..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/project_service_test.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/project_service_pb" -require "google/cloud/discovery_engine/v1/project_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ProjectService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_provision_project - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - accept_data_use_terms = true - data_use_terms_version = "hello world" - - provision_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :provision_project, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["accept_data_use_terms"] - assert_equal "hello world", request["data_use_terms_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, provision_project_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.provision_project name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.provision_project ::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.provision_project({ name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.provision_project(::Google::Cloud::DiscoveryEngine::V1::ProvisionProjectRequest.new(name: name, accept_data_use_terms: accept_data_use_terms, data_use_terms_version: data_use_terms_version), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, provision_project_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ProjectService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb deleted file mode 100644 index 96f3663c3930..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/rank_service" - -class ::Google::Cloud::DiscoveryEngine::V1::RankService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_ranking_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.ranking_config_path project: "value0", location: "value1", ranking_config: "value2" - assert_equal "projects/value0/locations/value1/rankingConfigs/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb deleted file mode 100644 index 77760caccfda..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_rest_test.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/rank_service_pb" -require "google/cloud/discovery_engine/v1/rank_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_rank - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - ranking_config = "hello world" - model = "hello world" - top_n = 42 - query = "hello world" - records = [{}] - ignore_record_details_in_response = true - user_labels = {} - - rank_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::ServiceStub.stub :transcode_rank_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rank_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.rank ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.rank ::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.rank(::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, rank_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb deleted file mode 100644 index 231550d4317b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/rank_service_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/rank_service_pb" -require "google/cloud/discovery_engine/v1/rank_service" - -class ::Google::Cloud::DiscoveryEngine::V1::RankService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_rank - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::RankResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - ranking_config = "hello world" - model = "hello world" - top_n = 42 - query = "hello world" - records = [{}] - ignore_record_details_in_response = true - user_labels = {} - - rank_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rank, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankRequest, request - assert_equal "hello world", request["ranking_config"] - assert_equal "hello world", request["model"] - assert_equal 42, request["top_n"] - assert_equal "hello world", request["query"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankingRecord, request["records"].first - assert_equal true, request["ignore_record_details_in_response"] - assert_equal({}, request["user_labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, rank_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rank ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rank ::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rank({ ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.rank(::Google::Cloud::DiscoveryEngine::V1::RankRequest.new(ranking_config: ranking_config, model: model, top_n: top_n, query: query, records: records, ignore_record_details_in_response: ignore_record_details_in_response, user_labels: user_labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rank_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RankService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RankService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb deleted file mode 100644 index 50e65c9ff2e4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_paths_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/recommendation_service" - -class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_engine_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb deleted file mode 100644 index a0d3952f0db5..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_rest_test.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/recommendation_service_pb" -require "google/cloud/discovery_engine/v1/recommendation_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_recommend - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - user_event = {} - page_size = 42 - filter = "hello world" - validate_only = true - params = {} - user_labels = {} - - recommend_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::ServiceStub.stub :transcode_recommend_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recommend_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recommend serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recommend ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recommend(::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recommend_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb deleted file mode 100644 index 5516ae9fb16f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/recommendation_service_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/recommendation_service_pb" -require "google/cloud/discovery_engine/v1/recommendation_service" - -class ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_recommend - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::RecommendResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - user_event = {} - page_size = 42 - filter = "hello world" - validate_only = true - params = {} - user_labels = {} - - recommend_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recommend, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserEvent), request["user_event"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["filter"] - assert_equal true, request["validate_only"] - assert_equal({}, request["params"].to_h) - assert_equal({}, request["user_labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, recommend_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recommend serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recommend ::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recommend({ serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recommend(::Google::Cloud::DiscoveryEngine::V1::RecommendRequest.new(serving_config: serving_config, user_event: user_event, page_size: page_size, filter: filter, validate_only: validate_only, params: params, user_labels: user_labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recommend_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecommendationService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb deleted file mode 100644 index baade7c854c6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/schema_service_pb" -require "google/cloud/discoveryengine/v1/schema_service_services_pb" -require "google/cloud/discovery_engine/v1/schema_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb deleted file mode 100644 index ad5915ba35ae..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_paths_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/schema_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.schema_path project: "value0", location: "value1", data_store: "value2", schema: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/schemas/value3", path - - path = client.schema_path project: "value0", location: "value1", collection: "value2", data_store: "value3", schema: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/schemas/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb deleted file mode 100644 index 4ca190ba8f3f..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_rest_test.rb +++ /dev/null @@ -1,374 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/schema_service_pb" -require "google/cloud/discovery_engine/v1/schema_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_schema - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Schema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_get_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_schema({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_schema name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_schema ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_schema({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_schema(::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_schema_client_stub.call_count - end - end - end - - def test_list_schemas - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_schemas_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_list_schemas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_schemas_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_schemas parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_schemas ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_schemas(::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_schemas_client_stub.call_count - end - end - end - - def test_create_schema - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - schema = {} - schema_id = "hello world" - - create_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_create_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_schema parent: parent, schema: schema, schema_id: schema_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_schema ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_schema(::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_schema_client_stub.call_count - end - end - end - - def test_update_schema - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - schema = {} - allow_missing = true - - update_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_update_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_schema({ schema: schema, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_schema schema: schema, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_schema ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_schema({ schema: schema, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_schema(::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_schema_client_stub.call_count - end - end - end - - def test_delete_schema - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_schema_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::ServiceStub.stub :transcode_delete_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_schema({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_schema name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_schema ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_schema({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_schema(::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_schema_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb deleted file mode 100644 index 38bc71d3a934..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/schema_service_test.rb +++ /dev/null @@ -1,438 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/schema_service_pb" -require "google/cloud/discovery_engine/v1/schema_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SchemaService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Schema.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_schema, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_schema({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_schema name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_schema ::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_schema({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_schema(::Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_schema_client_stub.call_rpc_count - end - end - - def test_list_schemas - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSchemasResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_schemas, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_schemas_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_schemas parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_schemas ::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_schemas({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_schemas(::Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_schemas_client_stub.call_rpc_count - end - end - - def test_create_schema - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - schema = {} - schema_id = "hello world" - - create_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_schema, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Schema), request["schema"] - assert_equal "hello world", request["schema_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_schema parent: parent, schema: schema, schema_id: schema_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_schema ::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_schema({ parent: parent, schema: schema, schema_id: schema_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_schema(::Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new(parent: parent, schema: schema, schema_id: schema_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_schema_client_stub.call_rpc_count - end - end - - def test_update_schema - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - schema = {} - allow_missing = true - - update_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_schema, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Schema), request["schema"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_schema({ schema: schema, allow_missing: allow_missing }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_schema schema: schema, allow_missing: allow_missing do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_schema ::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_schema({ schema: schema, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_schema(::Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new(schema: schema, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_schema_client_stub.call_rpc_count - end - end - - def test_delete_schema - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_schema, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_schema_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_schema({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_schema name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_schema ::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_schema({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_schema(::Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_schema_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SchemaService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb deleted file mode 100644 index 96f0dc940fb6..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_paths_test.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/search_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SearchService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_branch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.branch_path project: "value0", location: "value1", data_store: "value2", branch: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3", path - - path = client.branch_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb deleted file mode 100644 index ba40e49e7efa..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_rest_test.rb +++ /dev/null @@ -1,273 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/search_service_pb" -require "google/cloud/discovery_engine/v1/search_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_search - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - image_query = {} - page_size = 42 - page_token = "hello world" - offset = 42 - one_box_page_size = 42 - data_store_specs = [{}] - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - user_info = {} - language_code = "hello world" - facet_specs = [{}] - boost_spec = {} - params = {} - query_expansion_spec = {} - spell_correction_spec = {} - user_pseudo_id = "hello world" - content_search_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED - safe_search = true - user_labels = {} - natural_language_query_understanding_spec = {} - search_as_you_type_spec = {} - display_spec = {} - crowding_specs = [{}] - session = "hello world" - session_spec = {} - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - relevance_score_spec = {} - - search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.stub :transcode_search_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_client_stub.call_count - end - end - end - - def test_search_lite - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - image_query = {} - page_size = 42 - page_token = "hello world" - offset = 42 - one_box_page_size = 42 - data_store_specs = [{}] - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - user_info = {} - language_code = "hello world" - facet_specs = [{}] - boost_spec = {} - params = {} - query_expansion_spec = {} - spell_correction_spec = {} - user_pseudo_id = "hello world" - content_search_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED - safe_search = true - user_labels = {} - natural_language_query_understanding_spec = {} - search_as_you_type_spec = {} - display_spec = {} - crowding_specs = [{}] - session = "hello world" - session_spec = {} - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - relevance_score_spec = {} - - search_lite_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::ServiceStub.stub :transcode_search_lite_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_lite_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_lite_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb deleted file mode 100644 index 204810c8eff0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_service_test.rb +++ /dev/null @@ -1,362 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/search_service_pb" -require "google/cloud/discovery_engine/v1/search_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SearchService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_search - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - image_query = {} - page_size = 42 - page_token = "hello world" - offset = 42 - one_box_page_size = 42 - data_store_specs = [{}] - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - user_info = {} - language_code = "hello world" - facet_specs = [{}] - boost_spec = {} - params = {} - query_expansion_spec = {} - spell_correction_spec = {} - user_pseudo_id = "hello world" - content_search_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED - safe_search = true - user_labels = {} - natural_language_query_understanding_spec = {} - search_as_you_type_spec = {} - display_spec = {} - crowding_specs = [{}] - session = "hello world" - session_spec = {} - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - relevance_score_spec = {} - - search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal "hello world", request["branch"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["page_categories"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["offset"] - assert_equal 42, request["one_box_page_size"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, request["data_store_specs"].first - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["canonical_filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserInfo), request["user_info"] - assert_equal "hello world", request["language_code"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, request["facet_specs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] - assert_equal({}, request["params"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] - assert_equal "hello world", request["user_pseudo_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] - assert_equal "hello world", request["ranking_expression"] - assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] - assert_equal true, request["safe_search"] - assert_equal({}, request["user_labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_client_stub.call_rpc_count - end - end - - def test_search_lite - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - serving_config = "hello world" - branch = "hello world" - query = "hello world" - page_categories = ["hello world"] - image_query = {} - page_size = 42 - page_token = "hello world" - offset = 42 - one_box_page_size = 42 - data_store_specs = [{}] - filter = "hello world" - canonical_filter = "hello world" - order_by = "hello world" - user_info = {} - language_code = "hello world" - facet_specs = [{}] - boost_spec = {} - params = {} - query_expansion_spec = {} - spell_correction_spec = {} - user_pseudo_id = "hello world" - content_search_spec = {} - ranking_expression = "hello world" - ranking_expression_backend = :RANKING_EXPRESSION_BACKEND_UNSPECIFIED - safe_search = true - user_labels = {} - natural_language_query_understanding_spec = {} - search_as_you_type_spec = {} - display_spec = {} - crowding_specs = [{}] - session = "hello world" - session_spec = {} - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - relevance_score_spec = {} - - search_lite_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_lite, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest, request - assert_equal "hello world", request["serving_config"] - assert_equal "hello world", request["branch"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["page_categories"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ImageQuery), request["image_query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["offset"] - assert_equal 42, request["one_box_page_size"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec, request["data_store_specs"].first - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["canonical_filter"] - assert_equal "hello world", request["order_by"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserInfo), request["user_info"] - assert_equal "hello world", request["language_code"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::FacetSpec, request["facet_specs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec), request["boost_spec"] - assert_equal({}, request["params"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::QueryExpansionSpec), request["query_expansion_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SpellCorrectionSpec), request["spell_correction_spec"] - assert_equal "hello world", request["user_pseudo_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec), request["content_search_spec"] - assert_equal "hello world", request["ranking_expression"] - assert_equal :RANKING_EXPRESSION_BACKEND_UNSPECIFIED, request["ranking_expression_backend"] - assert_equal true, request["safe_search"] - assert_equal({}, request["user_labels"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::NaturalLanguageQueryUnderstandingSpec), request["natural_language_query_understanding_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SearchAsYouTypeSpec), request["search_as_you_type_spec"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DisplaySpec), request["display_spec"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::CrowdingSpec, request["crowding_specs"].first - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::SessionSpec), request["session_spec"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::SearchRequest::RelevanceScoreSpec), request["relevance_score_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_lite_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_lite serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_lite ::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_lite({ serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_lite(::Google::Cloud::DiscoveryEngine::V1::SearchRequest.new(serving_config: serving_config, branch: branch, query: query, page_categories: page_categories, image_query: image_query, page_size: page_size, page_token: page_token, offset: offset, one_box_page_size: one_box_page_size, data_store_specs: data_store_specs, filter: filter, canonical_filter: canonical_filter, order_by: order_by, user_info: user_info, language_code: language_code, facet_specs: facet_specs, boost_spec: boost_spec, params: params, query_expansion_spec: query_expansion_spec, spell_correction_spec: spell_correction_spec, user_pseudo_id: user_pseudo_id, content_search_spec: content_search_spec, ranking_expression: ranking_expression, ranking_expression_backend: ranking_expression_backend, safe_search: safe_search, user_labels: user_labels, natural_language_query_understanding_spec: natural_language_query_understanding_spec, search_as_you_type_spec: search_as_you_type_spec, display_spec: display_spec, crowding_specs: crowding_specs, session: session, session_spec: session_spec, relevance_threshold: relevance_threshold, relevance_score_spec: relevance_score_spec), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_lite_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb deleted file mode 100644 index 15dcc93625a8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" -require "google/cloud/discoveryengine/v1/search_tuning_service_services_pb" -require "google/cloud/discovery_engine/v1/search_tuning_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb deleted file mode 100644 index 8973cd9b3a49..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_paths_test.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/search_tuning_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb deleted file mode 100644 index b11219a791a3..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_rest_test.rb +++ /dev/null @@ -1,211 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" -require "google/cloud/discovery_engine/v1/search_tuning_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_train_custom_model - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - gcs_training_input = {} - data_store = "hello world" - model_type = "hello world" - error_config = {} - model_id = "hello world" - - train_custom_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.stub :transcode_train_custom_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, train_custom_model_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.train_custom_model gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.train_custom_model ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.train_custom_model(::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, train_custom_model_client_stub.call_count - end - end - end - - def test_list_custom_models - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - data_store = "hello world" - - list_custom_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::ServiceStub.stub :transcode_list_custom_models_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_models_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_custom_models({ data_store: data_store }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_custom_models data_store: data_store do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_custom_models ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_custom_models({ data_store: data_store }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_custom_models(::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_custom_models_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb deleted file mode 100644 index 8add24b8de2a..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/search_tuning_service_test.rb +++ /dev/null @@ -1,248 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/search_tuning_service_pb" -require "google/cloud/discovery_engine/v1/search_tuning_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_train_custom_model - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - gcs_training_input = {} - data_store = "hello world" - model_type = "hello world" - error_config = {} - model_id = "hello world" - - train_custom_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :train_custom_model, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest::GcsTrainingInput), request["gcs_training_input"] - assert_equal :gcs_training_input, request.training_input - assert_equal "hello world", request["data_store"] - assert_equal "hello world", request["model_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] - assert_equal "hello world", request["model_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, train_custom_model_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.train_custom_model gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.train_custom_model ::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.train_custom_model({ gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.train_custom_model(::Google::Cloud::DiscoveryEngine::V1::TrainCustomModelRequest.new(gcs_training_input: gcs_training_input, data_store: data_store, model_type: model_type, error_config: error_config, model_id: model_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, train_custom_model_client_stub.call_rpc_count - end - end - - def test_list_custom_models - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - data_store = "hello world" - - list_custom_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_models, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest, request - assert_equal "hello world", request["data_store"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_custom_models_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_custom_models({ data_store: data_store }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_custom_models data_store: data_store do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_custom_models ::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_custom_models({ data_store: data_store }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_custom_models(::Google::Cloud::DiscoveryEngine::V1::ListCustomModelsRequest.new(data_store: data_store), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_custom_models_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SearchTuningService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb deleted file mode 100644 index 63b6913d0e41..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_paths_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/serving_config_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_serving_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.serving_config_path project: "value0", location: "value1", data_store: "value2", serving_config: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/servingConfigs/value3", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", data_store: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/servingConfigs/value4", path - - path = client.serving_config_path project: "value0", location: "value1", collection: "value2", engine: "value3", serving_config: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/servingConfigs/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb deleted file mode 100644 index f382db848984..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/serving_config_service_pb" -require "google/cloud/discovery_engine/v1/serving_config_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_serving_config - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - serving_config = {} - update_mask = {} - - update_serving_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::ServiceStub.stub :transcode_update_serving_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_serving_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_serving_config serving_config: serving_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_serving_config ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_serving_config(::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_serving_config_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb deleted file mode 100644 index 931396d357a4..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/serving_config_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/serving_config_service_pb" -require "google/cloud/discovery_engine/v1/serving_config_service" - -class ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_update_serving_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ServingConfig.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - serving_config = {} - update_mask = {} - - update_serving_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_serving_config, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ServingConfig), request["serving_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_serving_config_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_serving_config serving_config: serving_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_serving_config ::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_serving_config({ serving_config: serving_config, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_serving_config(::Google::Cloud::DiscoveryEngine::V1::UpdateServingConfigRequest.new(serving_config: serving_config, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_serving_config_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb deleted file mode 100644 index 5ea2bf08ce22..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_paths_test.rb +++ /dev/null @@ -1,136 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/session_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SessionService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_answer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.answer_path project: "value0", location: "value1", data_store: "value2", session: "value3", answer: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3/answers/value4", path - - path = client.answer_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4", answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4/answers/value5", path - - path = client.answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/answers/value5", path - end - end - - def test_assist_answer_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.assist_answer_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4", assist_answer: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4/assistAnswers/value5", path - end - end - - def test_chunk_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.chunk_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4", chunk: "value5" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4/chunks/value5", path - - path = client.chunk_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5", chunk: "value6" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5/chunks/value6", path - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", data_store: "value2", session: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", data_store: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/sessions/value4", path - - path = client.session_path project: "value0", location: "value1", collection: "value2", engine: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3/sessions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb deleted file mode 100644 index c2fecba4e0cd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_rest_test.rb +++ /dev/null @@ -1,376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/session_service_pb" -require "google/cloud/discovery_engine/v1/session_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - - create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_session({ parent: parent, session: session }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_session parent: parent, session: session do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_session({ parent: parent, session: session }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_count - end - end - end - - def test_delete_session - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_session({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_session name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_session({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_count - end - end - end - - def test_update_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session = {} - update_mask = {} - - update_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_update_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_session({ session: session, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_session session: session, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_session({ session: session, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_session_client_stub.call_count - end - end - end - - def test_get_session - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - include_answer_details = true - - get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_session({ name: name, include_answer_details: include_answer_details }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_session name: name, include_answer_details: include_answer_details do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_session({ name: name, include_answer_details: include_answer_details }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_count - end - end - end - - def test_list_sessions - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb deleted file mode 100644 index 379a15167a97..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/session_service_test.rb +++ /dev/null @@ -1,413 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/session_service_pb" -require "google/cloud/discovery_engine/v1/session_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SessionService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - - create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session({ parent: parent, session: session }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session parent: parent, session: session do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session({ parent: parent, session: session }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new(parent: parent, session: session), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_rpc_count - end - end - - def test_delete_session - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_rpc_count - end - end - - def test_update_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session = {} - update_mask = {} - - update_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Session), request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_session({ session: session, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_session session: session, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_session ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_session({ session: session, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_session(::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new(session: session, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_session_client_stub.call_rpc_count - end - end - - def test_get_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - include_answer_details = true - - get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["include_answer_details"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session({ name: name, include_answer_details: include_answer_details }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session name: name, include_answer_details: include_answer_details do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session({ name: name, include_answer_details: include_answer_details }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new(name: name, include_answer_details: include_answer_details), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_rpc_count - end - end - - def test_list_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sessions, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SessionService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb deleted file mode 100644 index 3633b0511b7e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" -require "google/cloud/discoveryengine/v1/site_search_engine_service_services_pb" -require "google/cloud/discovery_engine/v1/site_search_engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb deleted file mode 100644 index bb0f95a6902e..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_paths_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/site_search_engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_site_search_engine_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.site_search_engine_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine", path - - path = client.site_search_engine_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine", path - end - end - - def test_sitemap_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.sitemap_path project: "value0", location: "value1", data_store: "value2", sitemap: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine/sitemaps/value3", path - - path = client.sitemap_path project: "value0", location: "value1", collection: "value2", data_store: "value3", sitemap: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine/sitemaps/value4", path - end - end - - def test_target_site_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.target_site_path project: "value0", location: "value1", data_store: "value2", target_site: "value3" - assert_equal "projects/value0/locations/value1/dataStores/value2/siteSearchEngine/targetSites/value3", path - - path = client.target_site_path project: "value0", location: "value1", collection: "value2", data_store: "value3", target_site: "value4" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/siteSearchEngine/targetSites/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb deleted file mode 100644 index d259bb6e0cd7..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_rest_test.rb +++ /dev/null @@ -1,919 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" -require "google/cloud/discovery_engine/v1/site_search_engine_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_site_search_engine - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_site_search_engine_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_get_site_search_engine_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_site_search_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_site_search_engine({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_site_search_engine name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_site_search_engine ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_site_search_engine({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_site_search_engine(::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_site_search_engine_client_stub.call_count - end - end - end - - def test_create_target_site - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - target_site = {} - - create_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_create_target_site_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_target_site({ parent: parent, target_site: target_site }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_target_site parent: parent, target_site: target_site do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_target_site ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_target_site({ parent: parent, target_site: target_site }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_target_site(::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_target_site_client_stub.call_count - end - end - end - - def test_batch_create_target_sites - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = [{}] - - batch_create_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_batch_create_target_sites_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_target_sites({ parent: parent, requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_target_sites parent: parent, requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_target_sites({ parent: parent, requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_target_sites_client_stub.call_count - end - end - end - - def test_get_target_site - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_get_target_site_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_target_site({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_target_site name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_target_site ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_target_site({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_target_site(::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_target_site_client_stub.call_count - end - end - end - - def test_update_target_site - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - target_site = {} - - update_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_update_target_site_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_target_site({ target_site: target_site }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_target_site target_site: target_site do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_target_site ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_target_site({ target_site: target_site }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_target_site(::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_target_site_client_stub.call_count - end - end - end - - def test_delete_target_site - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_target_site_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_delete_target_site_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_target_site({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_target_site name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_target_site ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_target_site({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_target_site(::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_target_site_client_stub.call_count - end - end - end - - def test_list_target_sites - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_list_target_sites_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_target_sites parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_target_sites ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_target_sites(::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_target_sites_client_stub.call_count - end - end - end - - def test_create_sitemap - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - sitemap = {} - - create_sitemap_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_create_sitemap_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_sitemap_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_sitemap({ parent: parent, sitemap: sitemap }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_sitemap parent: parent, sitemap: sitemap do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_sitemap ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_sitemap({ parent: parent, sitemap: sitemap }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_sitemap(::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_sitemap_client_stub.call_count - end - end - end - - def test_delete_sitemap - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_sitemap_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_delete_sitemap_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_sitemap_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_sitemap({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_sitemap name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_sitemap ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_sitemap({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_sitemap(::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_sitemap_client_stub.call_count - end - end - end - - def test_fetch_sitemaps - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - matcher = {} - - fetch_sitemaps_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_fetch_sitemaps_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_sitemaps_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_sitemaps({ parent: parent, matcher: matcher }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_sitemaps parent: parent, matcher: matcher do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_sitemaps ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_sitemaps({ parent: parent, matcher: matcher }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_sitemaps(::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_sitemaps_client_stub.call_count - end - end - end - - def test_enable_advanced_site_search - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - - enable_advanced_site_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_enable_advanced_site_search_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_advanced_site_search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.enable_advanced_site_search({ site_search_engine: site_search_engine }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.enable_advanced_site_search site_search_engine: site_search_engine do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.enable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.enable_advanced_site_search({ site_search_engine: site_search_engine }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.enable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_advanced_site_search_client_stub.call_count - end - end - end - - def test_disable_advanced_site_search - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - - disable_advanced_site_search_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_disable_advanced_site_search_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_advanced_site_search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.disable_advanced_site_search({ site_search_engine: site_search_engine }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.disable_advanced_site_search site_search_engine: site_search_engine do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.disable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.disable_advanced_site_search({ site_search_engine: site_search_engine }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.disable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_advanced_site_search_client_stub.call_count - end - end - end - - def test_recrawl_uris - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - uris = ["hello world"] - site_credential = "hello world" - - recrawl_uris_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_recrawl_uris_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, recrawl_uris_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.recrawl_uris site_search_engine: site_search_engine, uris: uris, site_credential: site_credential do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.recrawl_uris ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.recrawl_uris(::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, recrawl_uris_client_stub.call_count - end - end - end - - def test_batch_verify_target_sites - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - batch_verify_target_sites_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_batch_verify_target_sites_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_verify_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_verify_target_sites({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_verify_target_sites parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_verify_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_verify_target_sites({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_verify_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_verify_target_sites_client_stub.call_count - end - end - end - - def test_fetch_domain_verification_status - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - page_size = 42 - page_token = "hello world" - - fetch_domain_verification_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::ServiceStub.stub :transcode_fetch_domain_verification_status_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_domain_verification_status_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_domain_verification_status site_search_engine: site_search_engine, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_domain_verification_status ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_domain_verification_status(::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_domain_verification_status_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb deleted file mode 100644 index ddf9c8013405..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/site_search_engine_service_test.rb +++ /dev/null @@ -1,1068 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/site_search_engine_service_pb" -require "google/cloud/discovery_engine/v1/site_search_engine_service" - -class ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_site_search_engine - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_site_search_engine_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_site_search_engine, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_site_search_engine_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_site_search_engine({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_site_search_engine name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_site_search_engine ::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_site_search_engine({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_site_search_engine(::Google::Cloud::DiscoveryEngine::V1::GetSiteSearchEngineRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_site_search_engine_client_stub.call_rpc_count - end - end - - def test_create_target_site - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - target_site = {} - - create_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_target_site, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TargetSite), request["target_site"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_target_site({ parent: parent, target_site: target_site }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_target_site parent: parent, target_site: target_site do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_target_site ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_target_site({ parent: parent, target_site: target_site }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_target_site(::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest.new(parent: parent, target_site: target_site), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_target_site_client_stub.call_rpc_count - end - end - - def test_batch_create_target_sites - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = [{}] - - batch_create_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_target_sites, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateTargetSiteRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_target_sites({ parent: parent, requests: requests }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_create_target_sites parent: parent, requests: requests do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_create_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_create_target_sites({ parent: parent, requests: requests }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_create_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchCreateTargetSitesRequest.new(parent: parent, requests: requests), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_create_target_sites_client_stub.call_rpc_count - end - end - - def test_get_target_site - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::TargetSite.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_target_site, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_target_site({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_target_site name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_target_site ::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_target_site({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_target_site(::Google::Cloud::DiscoveryEngine::V1::GetTargetSiteRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_target_site_client_stub.call_rpc_count - end - end - - def test_update_target_site - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - target_site = {} - - update_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_target_site, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::TargetSite), request["target_site"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_target_site({ target_site: target_site }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_target_site target_site: target_site do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_target_site ::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_target_site({ target_site: target_site }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_target_site(::Google::Cloud::DiscoveryEngine::V1::UpdateTargetSiteRequest.new(target_site: target_site), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_target_site_client_stub.call_rpc_count - end - end - - def test_delete_target_site - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_target_site_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_target_site, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_target_site_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_target_site({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_target_site name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_target_site ::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_target_site({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_target_site(::Google::Cloud::DiscoveryEngine::V1::DeleteTargetSiteRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_target_site_client_stub.call_rpc_count - end - end - - def test_list_target_sites - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_target_sites, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_target_sites parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_target_sites ::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_target_sites({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_target_sites(::Google::Cloud::DiscoveryEngine::V1::ListTargetSitesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_target_sites_client_stub.call_rpc_count - end - end - - def test_create_sitemap - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - sitemap = {} - - create_sitemap_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_sitemap, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::Sitemap), request["sitemap"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_sitemap_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_sitemap({ parent: parent, sitemap: sitemap }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_sitemap parent: parent, sitemap: sitemap do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_sitemap ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_sitemap({ parent: parent, sitemap: sitemap }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_sitemap(::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new(parent: parent, sitemap: sitemap), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_sitemap_client_stub.call_rpc_count - end - end - - def test_delete_sitemap - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_sitemap_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_sitemap, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_sitemap_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_sitemap({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_sitemap name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_sitemap ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_sitemap({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_sitemap(::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_sitemap_client_stub.call_rpc_count - end - end - - def test_fetch_sitemaps - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - matcher = {} - - fetch_sitemaps_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_sitemaps, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher), request["matcher"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_sitemaps_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_sitemaps({ parent: parent, matcher: matcher }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_sitemaps parent: parent, matcher: matcher do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_sitemaps ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_sitemaps({ parent: parent, matcher: matcher }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_sitemaps(::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new(parent: parent, matcher: matcher), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_sitemaps_client_stub.call_rpc_count - end - end - - def test_enable_advanced_site_search - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - - enable_advanced_site_search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_advanced_site_search, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest, request - assert_equal "hello world", request["site_search_engine"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_advanced_site_search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.enable_advanced_site_search({ site_search_engine: site_search_engine }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.enable_advanced_site_search site_search_engine: site_search_engine do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.enable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.enable_advanced_site_search({ site_search_engine: site_search_engine }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.enable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::EnableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_advanced_site_search_client_stub.call_rpc_count - end - end - - def test_disable_advanced_site_search - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - - disable_advanced_site_search_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_advanced_site_search, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest, request - assert_equal "hello world", request["site_search_engine"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_advanced_site_search_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_advanced_site_search({ site_search_engine: site_search_engine }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_advanced_site_search site_search_engine: site_search_engine do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_advanced_site_search ::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_advanced_site_search({ site_search_engine: site_search_engine }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.disable_advanced_site_search(::Google::Cloud::DiscoveryEngine::V1::DisableAdvancedSiteSearchRequest.new(site_search_engine: site_search_engine), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_advanced_site_search_client_stub.call_rpc_count - end - end - - def test_recrawl_uris - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - uris = ["hello world"] - site_credential = "hello world" - - recrawl_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :recrawl_uris, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest, request - assert_equal "hello world", request["site_search_engine"] - assert_equal ["hello world"], request["uris"] - assert_equal "hello world", request["site_credential"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, recrawl_uris_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.recrawl_uris site_search_engine: site_search_engine, uris: uris, site_credential: site_credential do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.recrawl_uris ::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.recrawl_uris({ site_search_engine: site_search_engine, uris: uris, site_credential: site_credential }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.recrawl_uris(::Google::Cloud::DiscoveryEngine::V1::RecrawlUrisRequest.new(site_search_engine: site_search_engine, uris: uris, site_credential: site_credential), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, recrawl_uris_client_stub.call_rpc_count - end - end - - def test_batch_verify_target_sites - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - batch_verify_target_sites_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_verify_target_sites, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_verify_target_sites_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_verify_target_sites({ parent: parent }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_verify_target_sites parent: parent do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_verify_target_sites ::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_verify_target_sites({ parent: parent }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_verify_target_sites(::Google::Cloud::DiscoveryEngine::V1::BatchVerifyTargetSitesRequest.new(parent: parent), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_verify_target_sites_client_stub.call_rpc_count - end - end - - def test_fetch_domain_verification_status - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - site_search_engine = "hello world" - page_size = 42 - page_token = "hello world" - - fetch_domain_verification_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_domain_verification_status, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest, request - assert_equal "hello world", request["site_search_engine"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_domain_verification_status_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_domain_verification_status site_search_engine: site_search_engine, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_domain_verification_status ::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_domain_verification_status({ site_search_engine: site_search_engine, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_domain_verification_status(::Google::Cloud::DiscoveryEngine::V1::FetchDomainVerificationStatusRequest.new(site_search_engine: site_search_engine, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_domain_verification_status_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb deleted file mode 100644 index a55b3a9ae1fd..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/user_event_service_pb" -require "google/cloud/discoveryengine/v1/user_event_service_services_pb" -require "google/cloud/discovery_engine/v1/user_event_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb deleted file mode 100644 index de0c2e50d7c8..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_paths_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/user_event_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_data_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", path - - path = client.data_store_path project: "value0", location: "value1", collection: "value2", data_store: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3", path - end - end - - def test_document_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", location: "value1", data_store: "value2", branch: "value3", document: "value4" - assert_equal "projects/value0/locations/value1/dataStores/value2/branches/value3/documents/value4", path - - path = client.document_path project: "value0", location: "value1", collection: "value2", data_store: "value3", branch: "value4", document: "value5" - assert_equal "projects/value0/locations/value1/collections/value2/dataStores/value3/branches/value4/documents/value5", path - end - end - - def test_engine_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.engine_path project: "value0", location: "value1", collection: "value2", engine: "value3" - assert_equal "projects/value0/locations/value1/collections/value2/engines/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb deleted file mode 100644 index 5725b2104bb0..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_rest_test.rb +++ /dev/null @@ -1,324 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/user_event_service_pb" -require "google/cloud/discovery_engine/v1/user_event_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_write_user_event - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_event = {} - write_async = true - - write_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_write_user_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, write_user_event_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.write_user_event(::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, write_user_event_client_stub.call_count - end - end - end - - def test_collect_user_event - # Create test objects. - client_result = ::Google::Api::HttpBody.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - - collect_user_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_collect_user_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, collect_user_event_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.collect_user_event(::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, collect_user_event_client_stub.call_count - end - end - end - - def test_purge_user_events - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - force = true - - purge_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_purge_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_user_events_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_user_events({ parent: parent, filter: filter, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_user_events parent: parent, filter: filter, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_user_events ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_user_events({ parent: parent, filter: filter, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_user_events(::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_user_events_client_stub.call_count - end - end - end - - def test_import_user_events - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - - import_user_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::ServiceStub.stub :transcode_import_user_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_user_events_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_user_events inline_source: inline_source, parent: parent, error_config: error_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_user_events ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_user_events(::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_user_events_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb deleted file mode 100644 index 9b9fef582513..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_event_service_test.rb +++ /dev/null @@ -1,382 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/user_event_service_pb" -require "google/cloud/discovery_engine/v1/user_event_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserEventService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_write_user_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::UserEvent.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_event = {} - write_async = true - - write_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :write_user_event, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::UserEvent), request["user_event"] - assert request.has_user_event? - assert_equal true, request["write_async"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, write_user_event_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.write_user_event parent: parent, user_event: user_event, write_async: write_async do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.write_user_event ::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.write_user_event({ parent: parent, user_event: user_event, write_async: write_async }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.write_user_event(::Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new(parent: parent, user_event: user_event, write_async: write_async), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, write_user_event_client_stub.call_rpc_count - end - end - - def test_collect_user_event - # Create GRPC objects. - grpc_response = ::Google::Api::HttpBody.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_event = "hello world" - uri = "hello world" - ets = 42 - - collect_user_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :collect_user_event, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["user_event"] - assert_equal "hello world", request["uri"] - assert request.has_uri? - assert_equal 42, request["ets"] - assert request.has_ets? - refute_nil options - end - - Gapic::ServiceStub.stub :new, collect_user_event_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.collect_user_event parent: parent, user_event: user_event, uri: uri, ets: ets do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.collect_user_event ::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.collect_user_event({ parent: parent, user_event: user_event, uri: uri, ets: ets }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.collect_user_event(::Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new(parent: parent, user_event: user_event, uri: uri, ets: ets), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, collect_user_event_client_stub.call_rpc_count - end - end - - def test_purge_user_events - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - force = true - - purge_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_user_events, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_user_events_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_user_events({ parent: parent, filter: filter, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_user_events parent: parent, filter: filter, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_user_events ::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_user_events({ parent: parent, filter: filter, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_user_events(::Google::Cloud::DiscoveryEngine::V1::PurgeUserEventsRequest.new(parent: parent, filter: filter, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, purge_user_events_client_stub.call_rpc_count - end - end - - def test_import_user_events - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - error_config = {} - - import_user_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_user_events, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig), request["error_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_user_events_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_user_events inline_source: inline_source, parent: parent, error_config: error_config do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_user_events ::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_user_events({ inline_source: inline_source, parent: parent, error_config: error_config }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_user_events(::Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new(inline_source: inline_source, parent: parent, error_config: error_config), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_user_events_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserEventService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb deleted file mode 100644 index dc57a0e01983..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/user_license_service_pb" -require "google/cloud/discoveryengine/v1/user_license_service_services_pb" -require "google/cloud/discovery_engine/v1/user_license_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb deleted file mode 100644 index c412d15b7536..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discovery_engine/v1/user_license_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_license_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.license_config_path project: "value0", location: "value1", license_config: "value2" - assert_equal "projects/value0/locations/value1/licenseConfigs/value2", path - end - end - - def test_user_store_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.user_store_path project: "value0", location: "value1", user_store: "value2" - assert_equal "projects/value0/locations/value1/userStores/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb deleted file mode 100644 index 0c3a89010401..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_rest_test.rb +++ /dev/null @@ -1,212 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/discoveryengine/v1/user_license_service_pb" -require "google/cloud/discovery_engine/v1/user_license_service/rest" - - -class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_user_licenses - # Create test objects. - client_result = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_user_licenses_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.stub :transcode_list_user_licenses_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_user_licenses_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_user_licenses parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_user_licenses ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_user_licenses(::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_user_licenses_client_stub.call_count - end - end - end - - def test_batch_update_user_licenses - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - delete_unassigned_user_licenses = true - - batch_update_user_licenses_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::ServiceStub.stub :transcode_batch_update_user_licenses_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_user_licenses_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_update_user_licenses inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_update_user_licenses ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_update_user_licenses(::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_user_licenses_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb deleted file mode 100644 index 91d51627621b..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/google/cloud/discovery_engine/v1/user_license_service_test.rb +++ /dev/null @@ -1,255 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/discoveryengine/v1/user_license_service_pb" -require "google/cloud/discovery_engine/v1/user_license_service" - -class ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_user_licenses - # Create GRPC objects. - grpc_response = ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_user_licenses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_user_licenses, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_user_licenses_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_user_licenses parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_user_licenses ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_user_licenses({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_user_licenses(::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_user_licenses_client_stub.call_rpc_count - end - end - - def test_batch_update_user_licenses - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - inline_source = {} - parent = "hello world" - delete_unassigned_user_licenses = true - - batch_update_user_licenses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_user_licenses, name - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource), request["inline_source"] - assert_equal :inline_source, request.source - assert_equal "hello world", request["parent"] - assert_equal true, request["delete_unassigned_user_licenses"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_user_licenses_client_stub do - # Create client - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_update_user_licenses inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_update_user_licenses ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_update_user_licenses({ inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_update_user_licenses(::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new(inline_source: inline_source, parent: parent, delete_unassigned_user_licenses: delete_unassigned_user_licenses), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_update_user_licenses_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb b/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-discovery_engine-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"